DataGrid Update Flicker

J

Joe Hanna

Apologies if this has done the rounds. I have already checked Google but couldn't find an answer.

I am binding a DataGrid to a custom Collection (effectively an ArrayList). The DataGrid needs to have the DataSource member set to Nothing and then reassigned to the Collection to reflect any changes in the Collection. I also use the Select Method to highlight the modified/newly added row. This causes some untidy screen flicker.

Is there a DataGrid equivalent to the ListView.BeginUpdate/EndUpdate Methods or some other trick to produce a similar result?

Thanks in advance
Joe
 
A

Alex Feinman [MVP]

There are no such methods for data grid. For datagrid that bind to a changeable datasource, the data source should implement the IBindingList interface. This way the grid will get notified when the data has changed and updates only the changed row. I suggest that you derive your own class from ArrayList - a one that implements IBindingList
Apologies if this has done the rounds. I have already checked Google but couldn't find an answer.

I am binding a DataGrid to a custom Collection (effectively an ArrayList). The DataGrid needs to have the DataSource member set to Nothing and then reassigned to the Collection to reflect any changes in the Collection. I also use the Select Method to highlight the modified/newly added row. This causes some untidy screen flicker.

Is there a DataGrid equivalent to the ListView.BeginUpdate/EndUpdate Methods or some other trick to produce a similar result?

Thanks in advance
Joe
 
J

Joe Hanna

Thanks Alex.
There are no such methods for data grid. For datagrid that bind to a changeable datasource, the data source should implement the IBindingList interface. This way the grid will get notified when the data has changed and updates only the changed row. I suggest that you derive your own class from ArrayList - a one that implements IBindingList
Apologies if this has done the rounds. I have already checked Google but couldn't find an answer.

I am binding a DataGrid to a custom Collection (effectively an ArrayList). The DataGrid needs to have the DataSource member set to Nothing and then reassigned to the Collection to reflect any changes in the Collection. I also use the Select Method to highlight the modified/newly added row. This causes some untidy screen flicker.

Is there a DataGrid equivalent to the ListView.BeginUpdate/EndUpdate Methods or some other trick to produce a similar result?

Thanks in advance
Joe
 

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

Top