DataGrid: Suspend/ResumeLayout (DataView manipulations)?

A

alex n

hello.

i manipulate a dataview
(updating and thus filtering a large amount of rows)
and the datagrid bound to the dataview
slows down this process much by adjusting its scroll bars
and maybe trying to redraw itself.

ok, Suspend/ResumeLayout doesn't help.

grd.DataSource = null;
// update & filter here
grd.DataSource = dataview;

works but scrollbar positions are lost
after rebinding.
maybe that's no problem - i'll try
to store/restore scrollbars with windows scrollbar api.

but maybe there's some pure NET way to get
the DataGrid just taking rest while DataView is busy
with the stuff?

alex.
 
M

Miha Markic

Hi,

Why don't you store last position or last selected pk and reapply the
position to BindingManagerBase at the end?
 
A

alex n

the record position is stored in case of the rebinding,
there's no problem with it.

but the grid loses its scrollbar positions
so after rebinding the grid 'scrolls up' to the first row
although the record position stays the same.
 

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