I have a DevExpress XtraGrid.GridControl in a Winforms project that I'm using with a Master/Detail setup with multiple tables in a dataset that is bound at runtime. The visual behavior of the grid is somewhat erratic in that there is a dragable bar at the bottom of the visible grid section in the GridControl, that does not expand to the size of the control when the size of the data changes.
In my implementation, the GridControl is docked to fill the tab page that it occupies, and with this single exception works as expected. However the grid itself is only using half of the visible area available on the form. This is an issue because the data is over a full screen of rows and detail rows, but the user must manually resize the view by dragging the size bar to the bottom of the screen.
I'm manually expanding each view as they are registered, though this issue persists even when I do not automatically perform this and allow the user to expand them by clicking the plus sign. Here is the section of code that programmatically expands a view:
For x As Integer = 0 to v.RowCount - 1
For y as integer = 0 to v.GetRelationCount(x) - 1
v.ExpandMasterRow(x, y)
Next
Next
I have looked for a way to set a GridView object to 'dock' inside the GridControl, but have not found a way to. Is there a way to make the data fill the GridControl/View automatically? Thank you for any assistance on this issue.
It seems that when the XtraGrid creates a sub view, it ignores the DetailHeight of the parent view, in favor of the DetailHeight on the child view. Setting the view's DetailHeight as it is registered corrected the problem.
Private Sub grdMaster_ViewRegistered(sender As System.Object, e As DevExpress.XtraGrid.ViewOperationEventArgs) Handles grdMaster.ViewRegistered
Try
Select Case e.View.GetViewCaption()
Case "parent_child"
Dim view As Grid.GridView = e.View
view.DetailHeight = 10000
End Select
Catch ex As Exception
'handle error.
End Try
End Sub
Thank you all for your assistance and help.