Back to Devexpress

GridView.MasterRowCollapsing Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridview-db819e65.md

latest3.9 KB
Original Source

GridView.MasterRowCollapsing Event

Enables you to control whether master rows can be collapsed.

Namespace : DevExpress.XtraGrid.Views.Grid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("MasterDetail")]
public event MasterRowCanExpandEventHandler MasterRowCollapsing
vb
<DXCategory("MasterDetail")>
Public Event MasterRowCollapsing As MasterRowCanExpandEventHandler

Event Data

The MasterRowCollapsing event's data class is MasterRowCanExpandEventArgs. The following properties provide information specific to this event:

PropertyDescription
AllowGets or sets a value specifying whether the current operation is allowed.
RelationIndexGets the relation index that identifies the affected detail. Inherited from CustomMasterRowEventArgs.
RowHandleGets the handle of the currently processed master row in the current View. Inherited from CustomMasterRowEventArgs.

Remarks

The MasterRowCollapsing event is raised when attempting to collapse a master row. The master row can be identified using the event’s CustomMasterRowEventArgs.RowHandle parameter. If you need to prohibit row collapsing, set the MasterRowCanExpandEventArgs.Allow parameter to false. Note that the MasterRowCollapsing event is raised for each expanded master row when the GridView.CollapseAllDetails method is called. This enables you to control which master rows should be collapsed.

Note : the event’s CustomMasterRowEventArgs.RelationIndex parameter always returns -1. This tells you that the master row is affected as a whole rather than just an individual detail.

Please refer to the Master-Detail Relationships topic for additional information.

See Also

MasterRowCollapsed

MasterRowExpanded

MasterRowExpanding

SetMasterRowExpandedEx(Int32, Int32, Boolean)

Master-Detail Relationships

GridView Class

GridView Members

DevExpress.XtraGrid.Views.Grid Namespace