The name used to identify the relation between the master item and its detail items
dataGridDetailDescription
The DataGridDetailDescription that represents the relation in the DataGridCollectionView
Example
This example assumes that the grid is bound to the Orders table of the Northwind database.
The following example demonstrates how to create a custom detail-configuration selector that will return the appropriate detail configuration depending on the relation name, and in which a column is hidden and another is modified in its width and content alignment. The implementation of the OrdersDetailConfigurationSelector is provided below.
PublicClass OrdersDetailConfigurationSelector
Inherits DetailConfigurationSelector
PublicOverridesFunction SelectDetailConfiguration(ByVal relationName AsString, ByVal dataGridDetailDescription As DataGridDetailDescription) As DetailConfiguration
Dim detailConfig = NothingIf relationName = "OrdersOrderDetails"ThenDim discountColumn = New Column With {.FieldName = "Discount", .Visible = False}
Dim unitPriceColumn = New Column With {.FieldName = "UnitPrice", .Title = "Unit Price", .Width = 60, .CellHorizontalContentAlignment = HorizontalAlignment.Center}
detailConfig = New DetailConfiguration()
detailConfig.RelationName = relationName
detailConfig.AutoCreateDetailConfigurations = True
detailConfig.Columns.Add(discountColumn)
detailConfig.Columns.Add(unitPriceColumn)
EndIfReturn detailConfig
End FunctionEnd Class
Requirements
Target Platforms: Windows 11, Windows, 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2