Refreshing a grid

  • Thread starter Thread starter STom
  • Start date Start date
S

STom

I a standard WinForms app, I can refresh a datagrid by using the
SetDatabindings function. Within my ce app, this function does not appear to
be available.

What is the correct way to refresh a grid after a record has been added?

Thanks.

STom
 
This depends on what type of collection the grid is bound to, if it
implements IBindingList then it raises an event which will refresh the grid.
If it doesn't you can do this (assuming the control is bound to "mylist"):-
dataGrid1.Datasource = null;
dataGrid1.Datasource = mylist;

Peter
 
The datagrid is bound to a datatable in a dataset that I create from a
dataadapter using the Fill statement.

I suppose the same concept applies to rebinding the datatable like you have
below. I'll try it out.

Thanks.

STom
 

Ask a Question

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.

Ask a Question

Back
Top