Click here to Skip to main content
15,897,315 members

Getting new values from telerik Rad Grid TemplateColumn?

psychic6000 asked:

Open original thread
i Have this RadGrid, its working fine. most of the columns are readonly,

but the remaining column which is not readonly, i want it to be editable all the time, so i can click on it and start writing my new value in it. (its happening)

but i do not know how to extract those values from those field, i tried creating OntextChanged event so i can get the values but not happening, event isn't firing.

so How can i get the values from it?

XML
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" AutoGenerateEditColumn="True"
            CellSpacing="0" GridLines="None" Skin="Sunset"
            OnUpdateCommand="RadGrid1_UpdateCommand" OnEditCommand="RadGrid1_EditCommand" OnItemCommand="RadGrid1_ItemCommand"
            AllowMultiRowEdit="True"  EnableViewState="False" OnNeedDataSource="HandlerGridOnNeedDataSource"
             AllowAutomaticUpdates="true"
            >
        <clientsettings allowcolumnsreorder="True" reordercolumnsonclient="True">
            <Selecting AllowRowSelect="True" />
        </clientsettings>
        <mastertableview EditMode="InPlace">
            <commanditemsettings exporttopdftext="Export to PDF" />
            <rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column">
                <HeaderStyle Width="20px" />
            </rowindicatorcolumn>
            <expandcollapsecolumn filtercontrolalttext="Filter ExpandColumn column">
                <HeaderStyle Width="20px" />
            </expandcollapsecolumn>
            <Columns>

                <telerik:GridBoundColumn DataField="itemLineNo"
                    FilterControlAltText="Filter column column" HeaderText="Line No"
                    ReadOnly="True" UniqueName="column">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="itemName"
                    FilterControlAltText="Filter column1 column" HeaderText="Name" ReadOnly="True"
                    UniqueName="column1">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="itemPartNo"
                    FilterControlAltText="Filter column2 column" HeaderText="Part No"
                    ReadOnly="True" UniqueName="column2">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="itemShortDsc"
                    FilterControlAltText="Filter column3 column" HeaderText="Short Description"
                    ReadOnly="True" UniqueName="column3">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="itemLongDsc"
                    FilterControlAltText="Filter column4 column" HeaderText="Description"
                    ReadOnly="True" UniqueName="column4">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="itemQuantity"
                    FilterControlAltText="Filter column5 column" HeaderText="Quantity"
                    ReadOnly="True" UniqueName="column5">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="itemUOM"
                    FilterControlAltText="Filter column6 column" HeaderText="UOM" ReadOnly="True"
                    UniqueName="column6">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="Unit Cost" UniqueName="sItemUnitCost"
                    AutoPostBackOnFilter="True" >
                <ItemTemplate>
                    <telerik:RadTextBox id="Textbox50" Runat="server" Text='<%# Eval("sItemUnitCost") %> ' OnTextChanged="TextBox_TextChanged" />
                </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
            <editformsettings>
                <editcolumn filtercontrolalttext="Filter EditCommandColumn column">
                </editcolumn>
            </editformsettings>
        </mastertableview>
        <filtermenu enableimagesprites="False">
        </filtermenu>
        <headercontextmenu cssclass="GridContextMenu GridContextMenu_Default">
        </headercontextmenu>
        </telerik:RadGrid>
Tags: C#, ASP.NET, Templates, Telerik

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900