I Will create a checkbox inside the Rowdatabound.
When we check a checkbox it will show the ID of the Checkbox.How It is Works
protected void grdBindExcel_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
for (int i = 0; i < e.Row.Cells.Count; i++)
{
CheckBox checkBox = new CheckBox();
//checkBox.CssClass = "headerCheckBox";
string val = e.Row.Cells[i].Text;
checkBox.Text = val.ToString();
checkBox.ID = Convert.ToInt32(i).ToString();
e.Row.Cells[i].Controls.Add(checkBox);
checkBox.CheckedChanged += SelectCheckBox_OnCheckedChanged;
}
}
}