I have a WinGrid with the DisplayLayout.LoadStyle = LoadStyle.LoadOnDemand. I am then calling another form and from it invoking an asynchrpnous bind to the the wingrid's datasource. When I am doing this, I am seeing every row appear as it is loaded. Unfortunately when it is doing this, the columns widths are incorrect, and it only set the column width at the end. (I have DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns). This makes the grid look jumpy.
To work around this I initially made the whole grid invisible while loading, except this looks strange as well. I was hoping to find out how to hide the grids rows while loading while leaving the grid columns and outline visible. Thank you for your help,
Mike
Hi Mike,
You can probably get around the painting problem you are having by using the BeginUpdate and EndUpdate methods of the grid to prevent the grid from painting while the data is loaded.
But just an FYI - you have to be very careful about loading your data asynchronously. If you are not properly marshalling the data to the UI thread, this could cause serious problems with your application like crashing.
Thanks a lot for your anwser. I tried using the beginupdate/endupdate in the asynchronous method as well as outside the method, but it still displayed the same behaviour of displaying one row at a time. Any other ideas or is there something I might be missing? Thanks.