How to get the headertext from the gridview .
I want to get the Headertext and bind it in the Checkbox control
public void chk()
{
int a = Convert.ToInt32(lblaaa.Text);
foreach (GridViewRow row in grdBindExcel.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
for (int i = 0; i < row.Cells.Count; i++)
{
checkBox = new CheckBox();
string val = grdBindExcel.HeaderRow.Cells[i].Text;
checkBox.Text = val.ToString();
checkBox.ID = Convert.ToInt32(i).ToString();
}
}
}
}
<asp:CheckBox ID="checkBox" runat="server" />