My gridview has autogeneratecolumns = true and I want to get the specific column index value of where the user click on the gridview cell. If the user clicks on the cell of third row, fifth column, then it will show the Header text of Third Row & Fifth Column. How can I get the specific column index value. Please help me out.
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
Label1.Text = "RowHeader - " + GridView1.SelectedRow.Cells[0].Text + " and ColumnHeader - " + GridView1.HeaderRow.Cells[0].Text;
}