A
Aaron
I have a column called "notes" which may change position in the datagrid.
How do I find the index of this column based on its name?
How do I find the index of this column based on its name?
Eliyahu Goldin said:static public int IndexByName (System.Web.UI.WebControls.DataGrid
grid, string name)
{
for (int col = 0; col < grid.Columns.Count; col++)
if (grid.Columns[col].HeaderText == name)
return col;
return -1;
}
Eliyahu
Aaron said:Could you give me a code example?
Thanks,
Aaron
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.