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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Virtual grid drawing problem in MDI child

Thread ID:





17010 Jul 29,2004 02:13 AM UTC Jul 29,2004 06:34 AM UTC WinForms 1
Tags: GridControl
Asked On July 29, 2004 02:13 AM UTC

I have come across a very weird drawing problem with the Grid control, version 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

Administrator [Syncfusion]
Replied On July 29, 2004 06:34 AM UTC

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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon