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

Grid Size Problem with mdi child

Thread ID:





14973 Jun 9,2004 03:25 AM Jun 10,2004 04:30 AM Windows Forms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On June 9, 2004 03:25 AM

I have a grid on a mdi child form that is anchored at top,bottom,left and right so that it sizes proportionally to the size of the mdi child window. This works fine when resizing the window, and maximise and un-maximise. However when I minimise the mdi form then maximise it again the size of the grid control has extended past the boundaries form, and I get my buttons and text boxes floating over the top of the grid. Is the a problem with the grid or with my code, I have added the following event handlers to get my columns to size correctly. Code: Form Load AddHandler grd_Data.Model.QueryColWidth, AddressOf GetColWidth AddHandler grd_Data.SizeChanged, AddressOf SizeRefreshGrid Handler Code: Private Sub GetColWidth(ByVal sender As Object, ByVal e As GridRowColSizeEventArgs) If e.Index = 5 Then e.Size = grd_Data.ClientSize.Width - (Me.grd_Data.Model.ColWidths.GetTotal(1, 4) + Me.grd_Data.Model.ColWidths.GetTotal(6, 9)) e.Handled = True End If End Sub Private Sub SizeRefreshGrid(ByVal sender As Object, ByVal e As System.EventArgs) grd_Data.Refresh() End Sub Thanks again, Mark

Administrator [Syncfusion]
Replied On June 9, 2004 04:40 AM

I tried to see the problem in the attached sample and could not. Can you? Instead of using the grid''s Sized changed event to force a refresh, I think you can just set the grid.SmoothControlResize = false. (The sample uses this and and seems to redraw OK.) Just something else to try. Put a panel on the form where you now have the grid, and anchor the panel on all four sides like you have the grid. Then move your grid into the panel and set its Dock = Fill. MDI_9414.zip

Administrator [Syncfusion]
Replied On June 10, 2004 01:57 AM

Thanks for the sample, I can make the sample go wrong as well. Here is how I made it mess up. 1.) When form loads, minimise the child window onto the mdi parents dock. 2.) Restore the window to previous state by clicking on the first(two squares over each other) sizing control. Et Volia, grid is all messed up I have attched a zip with screen shots. I am running .net v1.1 vs latest version with all updates. Mark mdiscreens_3151.zip

Administrator [Syncfusion]
Replied On June 10, 2004 02:05 AM

Just tried that panel suggestion and its seems to have solved the sizing problem. Still would like to get it to work without the panel though. thanks, Mark

Administrator [Syncfusion]
Replied On June 10, 2004 04:30 AM

If you replace our grid with a DataGrid, then this problem seems to go away. So, it does appear to be something that different in the Syncfusion code. I will create a QA incident so that we can research it and see if it is something we can address. In the meantime, the panel work around seems to avoid the problem.


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.

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.