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
    [Collapse]Binding to Data Specifics
      Master-Detail: DataTable Use
      Master-Detail: Using Events
      Master-Detail: Implementing Master-Detail Relationships for Custom Objects
      Implement Master-Detail Relationships for Objects Using the IRelationList Interface
      Implement Master-Detail Relationships for Objects via Collection Properties
    [Expand]View Specifics
    [Expand]Row Specifics
   [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

Implement Master-Detail Relationships for Objects via Collection Properties

If a grid control is bound to a data source where each record object provides a property (or properties) of the IList type (e.g., ArrayList and List<T>), the elements of the collection properties are presented as detail Views.

Properties of the IList<T>, ICollection<T>, IEnumerable<T> and IEnumerable types are not recognized as collection properties by default. To treat them as collection properties, set the BaseView.DataController.AllowIEnumerableDetails option to true prior to binding a data source to the Grid Control.

Expanded Example


This example is from the Unbound Master View module of the GridTutorials project located at C:\Users\Public\Documents\DevExpress Demos 17.1\Components\WinForms\CS\GridTutorials. Please refer to this project for the complete code.

Consider a grid control that is bound to a data source, where each record is represented by the NestedRecord class.

The NestedRecord.ChildList property is of the ArrayList type. Thus, for each record in the bound data source, this property's contents will be presented as a detail View (unless the GridOptionsDetail.EnableMasterViewMode property is set to false)..

Expanded See Also

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