i have a record of a gridviewrowcollection. and i’m having issues with adding them to the grid.
GridViewRowCollection dr = new GridViewRowCollection(list);
StatisticsGrid.DataSource = dr;
doesnt work.
StatisticsGrid.Rows
does have an add method, what is strange
how can i add a gridviewrowcollection without creating a datatable + binding it to the datasource??
thanks in advance
A
GridViewneeds to be bound to aDataSourceof some type. The GridViewRowCollection is immutable.Depending on what you want to bind you might find it more fitting to bind to a generic list. This has the benefits over a
DataSetof being strongly-typed and more naturally fitting to a domain-model: