Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
Hiding grid loading when doing an asynchronous load and LoadStyle.LoadOnDemand
posted

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

Parents
  • 469350
    Offline posted

    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.

Reply Children
No Data