GridView.SetRowExpanded(Int32, Boolean, Boolean) Method
Expands or collapses the specified group row and, optionally, the child group rows at all nesting levels.
NuGet Package: DevExpress.Win.Grid
public void SetRowExpanded( int rowHandle, bool expanded, bool recursive )
Public Sub SetRowExpanded( rowHandle As Integer, expanded As Boolean, recursive As Boolean )
An integer value identifying the group row by its handle.
true to expand the group row; false to collapse it.
true to expand/collapse child group rows at all nesting levels; false to preserve the expanded state of child group rows.
The SetRowExpanded method raises either the GridView.GroupRowExpanding or GridView.GroupRowCollapsing event. These events allow you to prevent the row from being expanded or collapsed respectively. If a row has been expanded or collapsed successfully, the GridView.GroupRowExpanded or GridView.GroupRowCollapsed event is raised respectively.
If the specified handle points to a data row, the method does nothing.
Please refer to the Working with Groups in Code topic for additional information.
Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the SetRowExpanded member must not be invoked for these Views. The SetRowExpanded member can only be used with Views that display real data within the Grid Control. Use the following methods to access these Views with which an end user interacts at runtime.
- GridControl.MainView - returns the top most View in a grid;
- GridControl.FocusedView - returns the focused View;
- GridControl.DefaultView - returns the currently maximized View;
- the sender parameter of View specific events;
- GridView.GetDetailView - returns a detail clone View for a specific master row.