<asp:GridView ID="GridView1" PageSize="5" OnPageIndexChanging="GridView1_PageIndexChanging" EnableModelValidation="true" OnRowEditing="GridView1_RowEditing" AutoGenerateColumns="False" runat="server" AllowPaging="True" ShowHeaderWhenEmpty="True" AllowSorting="True" DataKeyNames="Id" OnRowUpdating="GridView1_RowUpdating" OnRowDataBound="GridView1_RowDataBound" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" ForeColor="Black"> <Columns> <asp:TemplateField HeaderText="ID"> <HeaderTemplate> <asp:TextBox ID="txtid" runat="server" CssClass="search_textbox" placeholder="Id"></asp:TextBox> <asp:LinkButton ID="lnkbtnid" runat="server" Text="Id" ForeColor="White"></asp:LinkButton> </HeaderTemplate> <ItemTemplate> <asp:Label ID="lblcustid" runat="server" Text='<%#Eval("Id") %>'></asp:Label> </ItemTemplate> </asp:TemplateField>
foreach(GridViewRow gdv in GridView1.Rows){ if (gdv.RowType == DataControlRowType.Header) { //Find the control here. TextBox txt = (TextBox)gdv.HeaderRow.FindControl("txt"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)