question with Datagrid.datasource ...

  • Thread starter Thread starter VM
  • Start date Start date
V

VM

If I'm filling a DataTable and, in the middle of the table fill, I set the
datagrid.datasource to this table, how can I stop the grid from reflecting
the changes from the table after I set the dartasource? Since I' m not sure
I'm explainng it well, here's some pseudocode:

for (int i =0;i<20000;i++)
{
rowAudit = mytable.NewRow();
// Code fills rowAudit
mytable.Rows.Add(rowAudit);
if (i == 500)
{
mygrid.DataSource = mytable;
//there are still 19500 rows to go but I don't want to see them in
the grid even though they'll be added to the table.
}
}
 
Hi,

If you are using a asp.net datagrid you can do so by calling
DataGrid.DataBind() the grid will get only the rows that exist at that
moment in the table

I don;t know if that will work with a win. app based grid.


Cheers,
 
Back
Top