[解决]请建议我从Gridview中访问txtmeasuredvar值的解决方案控制代码中的值。 [英] [Solved] Please suggest me the solution for accessing the value of txtmeasuredvar from Gridview controls values in the code.
本文介绍了[解决]请建议我从Gridview中访问txtmeasuredvar值的解决方案控制代码中的值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图从代码中访问follwing字段的值
< asp:TemplateField HeaderText = 测量变量 >
< ItemTemplate >
< asp:TextBox ID = txtmeasuredvar runat = ser ver MaxLength = 500 宽度 = 113px
高度 = 40px > < / asp :TextBox >
< asp:RequiredFieldValidator ID = RequiredFieldValidator2 runat = server ControlToValidate = txtmeasuredvar
< span class =code-attribute> ErrorMessage = * SetFocusOnError < span class =code-keyword> = True ValidationGroup = valgrp_func > < / asp:RequiredFieldValidator >
< / ItemTemplate >
< HeaderStyle 宽度 = 120px / >
< ItemStyle 宽度 = 120px / >
< / asp:TemplateField >
哪个位于gridview和UpdatePanel中的gridview。
解决方案
GridView.Rows [RowIndex] .Cells [CellIndex] .FindControl(ControlId)
Am trying to access the value of follwing field from code
<asp:TemplateField HeaderText="Measured variable">
<ItemTemplate>
<asp:TextBox ID="txtmeasuredvar" runat="server" MaxLength="500" Width="113px"
Height="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtmeasuredvar"
ErrorMessage="*" SetFocusOnError="True" ValidationGroup="valgrp_func"></asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle Width="120px" />
<ItemStyle Width="120px" />
</asp:TemplateField>
Which is in gridview and the gridview in the UpdatePanel.
解决方案
GridView.Rows[RowIndex].Cells[CellIndex].FindControl(ControlId)
这篇关于[解决]请建议我从Gridview中访问txtmeasuredvar值的解决方案控制代码中的值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文