Back to Devexpress

BaseView.IsDetailView Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-baseview-e276c410.md

latest4.3 KB
Original Source

BaseView.IsDetailView Property

Gets a value indicating whether the current View is a detail 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 bool IsDetailView { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property IsDetailView As Boolean

Property Value

TypeDescription
Boolean

true if the current View is a detail View; otherwise, false.

|

Remarks

The return value of the IsDetailView property indicates whether a View has a parent View. Thus, it returns false for the GridControl.MainView which has a zero nesting level and for detail pattern Views. For detail clone Views, the property returns true.

To obtain the nested level of a view, use the BaseView.DetailLevel property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the IsDetailView 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#L25

csharp
{
    if (_GridView.IsDetailView)
    {

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

csharp
ColumnView view = (ColumnView)gridControl1.FocusedView;
if(!view.IsDetailView) return;

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

vb
Private Sub _GridView_SelectionChanged(ByVal sender As Object, ByVal e As DevExpress.Data.SelectionChangedEventArgs)
    If _GridView.IsDetailView Then
        Dim masterRowHandle As Integer = _GridView.SourceRowHandle

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

vb
Dim view As ColumnView = CType(gridControl1.FocusedView, ColumnView)
If Not view.IsDetailView Then Return
Dim key As Object = GetRowKey(CType(view.ParentView, ColumnView), view.SourceRowHandle)

See Also

DetailLevel

LevelTree

MainView

BaseView Class

BaseView Members

DevExpress.XtraGrid.Views.Base Namespace