Back to Devexpress

BaseView.SourceRowHandle Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-baseview-658ba586.md

latest5.0 KB
Original Source

BaseView.SourceRowHandle Property

Gets the handle of a master row for a View.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[Browsable(false)]
public virtual int SourceRowHandle { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property SourceRowHandle As Integer

Property Value

TypeDescription
Int32

An integer value representing a master row handle for the current detail View.

|

Remarks

This property is useful for clones of detail Views only. For the GridControl.MainView and pattern Views, the SourceRowHandle property returns the GridControl.InvalidRowHandle field value.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SourceRowHandle 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-select-detail-rows-when-selecting-master-row/CS/MasterDetailSelectionHelper.cs#L27

csharp
{
    int masterRowHandle = _GridView.SourceRowHandle;
    if (_GridView.GetSelectedRows().Length == _GridView.RowCount)

winforms-grid-vertically-align-detail-views/CS/DetailsUnderEachOther/Form1.cs#L82

csharp
GridView realMasterView = (GridView)fakeMasterView.ParentView;
int realMasterRow = fakeMasterView.SourceRowHandle;
int realListSourceRow = realMasterView.GetDataSourceRowIndex(realMasterRow);

winforms-grid-load-refresh-detail-data-from-database/CS/WindowsApplication297/Form1.cs#L63

csharp
object key = GetRowKey((ColumnView)view.ParentView, view.SourceRowHandle);
DataView dv = cache[key] as DataView;

winforms-grid-select-detail-rows-when-selecting-master-row/VB/MasterDetailSelectionHelper.vb#L23

vb
If _GridView.IsDetailView Then
    Dim masterRowHandle As Integer = _GridView.SourceRowHandle
    If _GridView.GetSelectedRows().Length = _GridView.RowCount Then

winforms-grid-vertically-align-detail-views/VB/DetailsUnderEachOther/Form1.vb#L86

vb
Dim realMasterView As GridView = CType(fakeMasterView.ParentView, GridView)
Dim realMasterRow As Integer = fakeMasterView.SourceRowHandle
Dim realListSourceRow As Integer = realMasterView.GetDataSourceRowIndex(realMasterRow)

winforms-grid-load-refresh-detail-data-from-database/VB/WindowsApplication297/Form1.vb#L63

vb
If Not view.IsDetailView Then Return
Dim key As Object = GetRowKey(CType(view.ParentView, ColumnView), view.SourceRowHandle)
Dim dv As DataView = TryCast(cache(key), DataView)

See Also

ParentView

SourceRow

BaseView Class

BaseView Members

DevExpress.XtraGrid.Views.Base Namespace