Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

  • 2 minutes to read

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:

outlook_tut_les6_1

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

outlook_tut_les6_2

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.

outlook_tut_les6_3

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.

outlook_tut_les6_4

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.

outlook_tut_les6_5

#Result

View Example

See Also