[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Expand]Controls and Libraries
 [Collapse]Scaffolding Wizard
   Getting Started
  [Expand]Data Access Layer
   UI Generation
   [Collapse]Building Outlook-Inspired and Hybrid UI Applications
     Lesson 1 - Automatically Generate Outlook-Inspired and Hybrid User Interfaces From Entity Framework
     Lesson 2 - Show Splash Screen on the Start of the Application
     Lesson 3 - Customize Layout of the Collection Views
     Lesson 4 - Show Sparkline Charts in Grid Cells
     Lesson 5 - Use Cards Layout in Collection Views
     Lesson 6 - Use Master-detail Data Representation in Collection Views
     Lesson 7 - Using Conditional Formatting in Grid
     Lesson 8 - Add Advanced End-user Filtering Functionality to Applications
     Lesson 9 - Show Windows 8-style Toast Notifications
     Lesson 10 - Add Windows 7-style Jump List to the Application
     Lesson 11 - Add Custom Actions to Application's Taskbar Thumbnail
   [Expand]Building Office-Inspired Applications
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Lesson 6 - Use Master-detail Data Representation in Collection Views

In this lesson, you will add the Master-Detail Data Representation to the CustomerCollectionView, so it displays the Customer.Orders detail collection within the GridControl.

Open the CustomerCollectionView.xaml file and run the designer. Create the following column layout in the same way as it is described in the previous lesson:

Select the GridControl, find the GridControl.DetailDescriptor property in the PropertyGrid, and create a new DataControlDetailDescriptor to set as the property value.

Configure the created DataControlDetail descriptor. Set its DataControlDetailDescriptor.ItemsSourcePath property to Orders and create a new GridControl to set as the DataControlDetailDescriptor.DataControl property value.

Configure the generated detail GridControl. Find its GridControl.Columns property within the Properties window and invoke the Colleciton Editor window. In the Collection Editor window, click the Add button to create a new detail GridColumn and set its ColumnBase.FieldName property to InvoiceNumber, the BaseColumn.Header property to INVOICE NUMBER, the ColumnBase.IsSmart property to True.

Proceed with creating columns for the following detail record properties: Employee.FullName, OrderDate, ShipDate, SaleAmount, ShippingAmount, TotalAmount. Click the OK button and run the application.

Expanded Result

Expanded See Also

Is this topic helpful?​​​​​​​