Log In
[Expand]General Information
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Expand]Grid View
   [Expand]View Technology
   [Expand]Data Editing
   [Expand]Filtering and Locating Rows
   [Expand]Focus and Selection Handling
   [Expand]Processing Rows
   [Expand]Formatting Cell Values
   [Collapse]Master-Detail Relationships
     Master-Detail Overview
    [Expand]Binding to Data Specifics
    [Expand]View Specifics
    [Collapse]Row Specifics
      Expanding and Collapsing Master Rows
      Navigating Through Master and Detail Rows
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
   [Expand]Batch Modifications
   [Expand]Hit Information
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Navigating Through Master and Detail Rows

In master-detail mode, expanding master rows provides access to detail Views. Master rows can have multiple detail Views, each of which represents data from a corresponding master-detail relationship. This must be taken into account when traversing rows in master and detail Views.

Expanded Navigating Through Master and Detail Rows

You can open a particular detail View by calling the GridView.ExpandMasterRow, GridView.SetMasterRowExpanded or GridView.SetMasterRowExpandedEx methods. Refer to the Expanding and Collapsing Master Rows section for details on using these methods.

Once the detail View is opened, you can access it via the GridView.GetDetailView method. This returns a detail clone representing the master-detail relationship required for a particular master row. Note that the method might return null (Nothing in Visual Basic) if the detail View cannot be obtained. For instance, if the corresponding master-detail relationship does not contain data and the GridOptionsDetail.AllowExpandEmptyDetails property is set to false, then the detail View for that relationship is not created.

To obtain information about navigating within a single view, you can refer to the Traversing Rows document. You can allow the end-user to navigate Views via the embedded and external navigator controls.

Sometimes you may need to determine the master View for the current detail View. For this purpose, you can use the BaseView.ParentView property. The BaseView.SourceRowHandle property returns the row handle of the master row that owns the detail View. For information on row handles, see the Identifying Rows and Cards topic.

The following code lists the NavigateDetails procedure that shows how to navigate master-detail rows. The method traverses through rows of the specified View. If a row has detail Views, they are opened and traversed via a recursive call of NavigateDetails. The number of detail Views for a row is retrieved via the GridView.GetRelationCount function.

detail Views can be GridView or CardView descendants.

The code is enclosed by calls to the BaseView.BeginUpdate and BaseView.EndUpdate methods to prevent excessive repainting.

Expanded See Also

How would you rate this topic?​​​​​​​