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
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
Private Sub SizeRefreshGrid(ByVal sender As Object, ByVal e As System.EventArgs)
Thanks again, Mark
ADAdministrator Syncfusion Team 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.
ADAdministrator Syncfusion Team 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.
ADAdministrator Syncfusion Team 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.
ADAdministrator Syncfusion Team 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.