windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-custommasterroweventargs-e6fb9492.md
Gets the handle of the currently processed master row in the current View.
Namespace : DevExpress.XtraGrid.Views.Grid
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public int RowHandle { get; }
Public ReadOnly Property RowHandle As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value representing a row handle.
|
Use the RowHandle property to identify the row for which an event has been raised. Note that in some instances, identifying the master row is insufficient. If a master row has several details, you also need to identify which detail is currently processed. For this purpose, read the CustomMasterRowEventArgs.RelationIndex property value.
The following code snippets (auto-collected from DevExpress Examples) contain references to the RowHandle property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-master-detail-entity-framework/CS/Entities/Form1.cs#L18
private void OnMasterRowEmpty(object sender, DevExpress.XtraGrid.Views.Grid.MasterRowEmptyEventArgs e) {
Product p = (Product)gridView1.GetRow(e.RowHandle);
e.IsEmpty = p.Order_Details.Count == 0;
winforms-grid-vertically-align-detail-views/CS/DetailsUnderEachOther/Form1.cs#L75
private void gvRelations_MasterRowGetRelationName(object sender, DevExpress.XtraGrid.Views.Grid.MasterRowGetRelationNameEventArgs e) {
e.RelationName = GetRelationName((GridView)sender, e.RowHandle);
}
XPO_how-to-filter-an-associated-collection-in-legacy-xpo-versions-e876/CS/Form1.cs#L19
GridView masterGrid = sender as GridView;
Category category = (Category)masterGrid.GetRow(e.RowHandle);
e.ChildList = category.AvailableProducts;
XPO_how-to-bind-a-non-persistent-collection-property-to-a-grid-control-e2062/CS/Form1.cs#L19
GridView masterGrid = sender as GridView;
Category category = (Category)masterGrid.GetRow(e.RowHandle);
e.ChildList = category.AvailableProducts;
winforms-grid-auto-expand-new-master-row/CS/Q205071/Form1.cs#L55
view.MasterRowExpanded -= OnGridViewMasterRowExpanded;
GridView childView = (GridView)view.GetDetailView(e.RowHandle, e.RelationIndex);
childView.AddNewRow();
winforms-grid-master-detail-entity-framework/VB/Entities/Form1.vb#L20
Private Sub OnMasterRowEmpty(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.MasterRowEmptyEventArgs) Handles gridView1.MasterRowEmpty
Dim p As Product = CType(gridView1.GetRow(e.RowHandle), Product)
e.IsEmpty = p.Order_Details.Count = 0
winforms-grid-vertically-align-detail-views/VB/DetailsUnderEachOther/Form1.vb#L80
Private Sub gvRelations_MasterRowGetRelationName(ByVal sender As Object, ByVal e As MasterRowGetRelationNameEventArgs)
e.RelationName = GetRelationName(CType(sender, GridView), e.RowHandle)
End Sub
XPO_how-to-filter-an-associated-collection-in-legacy-xpo-versions-e876/VB/Form1.vb#L21
Dim masterGrid As GridView = TryCast(sender, GridView)
Dim category As Category = CType(masterGrid.GetRow(e.RowHandle), Category)
e.ChildList = category.AvailableProducts
XPO_how-to-bind-a-non-persistent-collection-property-to-a-grid-control-e2062/VB/Form1.vb#L21
Dim masterGrid As GridView = TryCast(sender, GridView)
Dim category As Category = CType(masterGrid.GetRow(e.RowHandle), Category)
e.ChildList = category.AvailableProducts
winforms-grid-auto-expand-new-master-row/VB/Q205071/Form1.vb#L57
RemoveHandler view.MasterRowExpanded, AddressOf OnGridViewMasterRowExpanded
Dim childView As GridView = CType(view.GetDetailView(e.RowHandle, e.RelationIndex), GridView)
childView.AddNewRow()
See Also
CustomMasterRowEventArgs Class