简体   繁体   English

如何在RadGrid中绑定和使用文本框

[英]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? 我有一个RadGrid,我想在RadGrid内插入一些文本框以插入数据,我该怎么做?

<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 . 这是我在RadGrid内的文本框,我不确定这是最好的方法,请帮助我使用每个文本框,我不知道如何从后面的代码中的每个文本框获取价值,并且在gird中创建文本框的工作正确或不 。 i have 11 static rows and 6 field at all , thanks for help 我有11个静态行和6个字段,谢谢您的帮助

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

Telerik has a good documentation. Telerik有一个很好的文档。 There aa lot of ways to accomplish that. 有很多方法可以做到这一点。 And there are small differences (using inplace edit / form edit etc...) 并且存在细微差异(使用就地编辑/表单编辑等...)

How to use Custom Templates with RadGrid 如何在RadGrid中使用自定义模板

Here you can find also a good Documentation about accessing those values. 在这里您还可以找到有关访问这些值的良好文档。

How to access Template Values 如何访问模板值

So the answer is RTFM :) 所以答案是RTFM :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM