DataGridView row index question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I display a column that contains a simple indexing of the rows.0,1,2,
Isnt there a built in property I can use or must I implement it myself by
creating a new column and refreshing the indexes each time a new item is
added or deleted. It must support deleting updating adding rows.
what I do now is each time a row is added or removed
foreach(DataRow r in m_Table.Rows)
{
d["Index" ] = m_Table.Rows.IndexOf(d);
}

There must be a more elegant way to do this ?
 
Back
Top