Resize with AutoStretchColumnsToFitWidth Very Slow!

Dec 17, 2009 at 3:28 AM

When i put

.AutoStretchColumnsToFitWidth = True

In example 53, generates a BIG! inestability issue, when the window (consequently the grid) is resized.

can this be solved with a workaround?, something like .disablepainting .enablepainting, or else for use in events like beginresize and endresize?


Dec 17, 2009 at 5:04 AM

What is that instability? Does it crash, window flicker, grid dissappears?

Dec 17, 2009 at 8:20 AM

Sorry, Window freezes (is in the main thread, then the main thread frezzes) just a moment and then is released, but is long time to wait.
And the user experience is like app hang.


Dec 19, 2009 at 9:21 AM

I suggest to simply not use that flag.


Sample 53 uses lots of rows, and you simply can not resize ALL columns in an instance, since there is 100k - 1000k rows.  I suggest you to manually autosize columns. Or autosize automatically only the visible cells. You can do that by calling dataGrid.Columns.AutoSizeView();    

Dec 19, 2009 at 2:43 PM

Yes, i suggested to myself the same!, i will try AutoSizeView method.