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
    [Collapse]View Specifics
      Detail Pattern and Clone Views
      Specify Views to Represent Detail Data
      Master and Detail View Vertical Scrolling (Embedded Detail Mode)
      Detail View Size
      Synchronizing Detail Views
      Zooming Views
      Using Detail ToolTips
      Using Detail Tabs
    [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

Specify Views to Represent Detail Data

To customize a View displaying data from a master data source, you can use the GridControl.MainView property, or at design time, you can use the (MainView) level in the Level Designer.

If you need to specify how detail data should be displayed, you have to create a pattern View and associate it with a specific relationship. To do this, use the Level Designer at design time, and use the GridControl.LevelTree tree at runtime.

To associate a pattern View with a master-detail relationship, a level must be created. A level is an association of a relationship with a pattern View. At design time, you can create a new level by clicking the Click here to create a new level link in the Level Designer. At runtime, a level can be created using the methods provided by the GridControl.LevelTree object.

Take special note of the created level's name. The name must match the name of the master-detail relationship with which the View is associated. If you implement master-detail relationships via the grid's events, the level's name must match the name provided via the GridView.MasterRowGetRelationName event. If you implement master-detail relationships via the IRelationList interface, the level's name must match the name provided via the IRelationList.GetRelationName method. If detail data is provided at the data source level via collection properties, the level's name must match the name of a collection property.

The following image shows the Level Designer, containing two levels for representing the Products and Customers master-detail relationships.

The following example shows how to create pattern Views for the Products and Customers relationships in code.

Note that if you don't create columns, the grid will create columns automatically, just before displaying the Views on screen.

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