We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Virtual grid drawing problem in MDI child

I have come across a very weird drawing problem with the Grid control, version 1.6.1.8 I''ve enclosed a simple app to demonstrate the problem. Quick summary: Virtual grid on a MDI child window that starts out maximized. First child window and grid show up fine. 2nd through N child windows cause the grid to paint slow and re-render a few times with different column widths, etc. Ends up destroying the MDI parent container and min/restore/max buttons. Run the app, choose File / New Virtual. Everything is fine. Again, choose File / New Virtual. This time, the grid is painted slowly, and you can see refreshes of the column widths. Also notice the min/restore/max buttons in the top right. There should only ever be one set of these, but now there are 2. Again, choose File / New Virtual. Now you''ll see THREE min/restore/max buttons in top right. Click the restore button to bring the child windows to a "cascaded" state - and you''ll see, the MDI children painting area is ruined. Note that if the child window property is set to show the window in Normal state (not maximized), I don''t see the problem. Also - the other menu choice, standard grid, doesn''t show this problem, even with maximized child forms. So it seems to be a problem with the virtual grid. Some questions: - Is there a way to turn off the QueryXXX calls during setup of the grid? After I call ResetVolatileData(), it seems that many of the calls to HideRows, AllowSelection, DefaultColWidth, etc. all cause calls to QueryColCount, etc. I tried Begin/EndUpdate and Suspend/ResumeLayout calls, but doesn''t work. THANK YOU VERY MUCH for looking into this... gridtest_6055.zip

1 Reply

AD Administrator Syncfusion Team July 29, 2004 01:34 AM

Try this as a simple work around. On Form2, put a Panel where you now have the grid and anchor it. Then drop the grid into the Panel and set grid.Dock = Fill. Then try things. I think what is going on is that the grid is being sized to the form before the form has had its final size setting. At this point, the row count event is not hook. Then later when the form is finally size (with the row count event hooked), things get confused. The grid does special handling of the initial positioning in a form, postponing it until the first time the grid is drawn. By making the grid''s parent the panel, this special form positioning code is avoided, and this seems to avoid this problem in your sample.

Loader.
Live Chat Icon For mobile
Up arrow icon