GridViewRow head = grid.HeaderRow; TextBox Tbx = head.FindControl("txtItem") as TextBox;
foreach (TableCell headerCell in GridView1.HeaderRow.Cells) { // or access Controls with index // headerCell.Controls[INDEX] Label lblHeader = headerCell.FindControl("headerLabel1") as Label; }
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)