|
how can I access to web control in the GridView and use it's value in codebehind structure. I know It will be somethng like this
"GridView_name.FindControl("x_FieldName")", but I do not know where to put it.I especially do not know how I should declare it.
below code is my webform code.and I want to access the "text" value in gridview in code behind.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="text" HeaderText="text" SortExpression="text" />
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BConnStr %>"
SelectCommand="SELECT [text], [id] FROM [art]"></asp:SqlDataSource>
|