Search code examples
c#asp.netradgrid

how to bind and use textbox in RadGrid


i have a RadGrid and i want some textBox inside RadGrid For insert Data How i can do this?

<telerik:GridTemplateColumn UniqueName="First" HeaderText="LastName">
                  <ItemTemplate>
                     <asp:TextBox ID="txt" runat="server"></asp:TextBox>
                           </ItemTemplate>
           </telerik:GridTemplateColumn>

<telerik:GridTemplateColumn UniqueName="LastName" HeaderText="LastName">
                      <ItemTemplate>
                         <asp:TextBox ID="txt1" runat="server"></asp:TextBox>
                               </ItemTemplate>
               </telerik:GridTemplateColumn>

this is my textBox inside of RadGrid and i not sure it's best way for this, please help me for use each of TextBoxes i don't know how to get value from each textboxes in code behind and that work for creat textbox in gird is correct or not . i have 11 static rows and 6 field at all , thanks for help

foreach (GridDataItem Dataitem in RIV_RateHireGrid.Items)
       {
            ???
       }

Solution

  • Telerik has a good documentation. There a a lot of ways to accomplish that. And there are small differences (using inplace edit / form edit etc...)

    How to use Custom Templates with RadGrid

    Here you can find also a good Documentation about accessing those values.

    How to access Template Values

    So the answer is RTFM :)