//instead of string you can place hidden variable id // i is cloumn index string colText = grid.Columns[i].HeaderText;