<syncfusion:SfDataGrid x:Name="dataGrid1"
AutoGenerateColumns="True"
ItemsSource="{Binding VM1}">
<syncfusion:SfDataGrid.DetailsViewDefinition>
<syncfusion:GridViewDefinition RelationalColumn="Class1Value1">
<syncfusion:GridViewDefinition.DataGrid>
<syncfusion:SfDataGrid x:Name="FirstDetailsViewGrid" AutoGenerateColumns="False"
Columns="{Binding Columns, Source={StaticResource viewmodel}, UpdateSourceTrigger=PropertyChanged}" >
</syncfusion:SfDataGrid>
</syncfusion:GridViewDefinition.DataGrid>
</syncfusion:GridViewDefinition>
</syncfusion:SfDataGrid.DetailsViewDefinition>
</syncfusion:SfDataGrid>
<syncfusion:SfDataGrid x:Name="dataGrid2"
Grid.Column="1"
AutoGenerateColumns="False"
Columns="{Binding Columns, Source={StaticResource viewmodel}, UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding VM2}" />
<syncfusion:SfDataGrid x:Name="dataGrid3"
Grid.Column="2"
AutoGenerateColumns="True"
ItemsSource="{Binding VM3}">
<syncfusion:SfDataGrid.DetailsViewDefinition>
<syncfusion:GridViewDefinition RelationalColumn="Class2Value3">
<syncfusion:GridViewDefinition.DataGrid>
<syncfusion:SfDataGrid x:Name="FirstDetailsViewGrid1" AutoGenerateColumns="False"
Columns="{Binding Columns, Source={StaticResource viewmodel}, UpdateSourceTrigger=PropertyChanged}">
</syncfusion:SfDataGrid>
</syncfusion:GridViewDefinition.DataGrid>
</syncfusion:GridViewDefinition>
<syncfusion:GridViewDefinition RelationalColumn="Class1Value3">
<syncfusion:GridViewDefinition.DataGrid>
<syncfusion:SfDataGrid x:Name="FirstDetailsViewGrid2" AutoGenerateColumns="True">
</syncfusion:SfDataGrid>
</syncfusion:GridViewDefinition.DataGrid>
</syncfusion:GridViewDefinition>
</syncfusion:SfDataGrid.DetailsViewDefinition>
</syncfusion:SfDataGrid> |
private Columns columns;
public Columns Columns
{
get
{
if (columns == null)
columns = GetColumns();
return columns;
}
set
{
this.columns = value;
OnPropertyChanged("Columns");
}
}
protected Columns GetColumns()
{
Columns _columns = new Columns();
GridNumericColumn ProductId;
ProductId = new GridNumericColumn()
{
MappingName = "ProductId",
};
_columns.Add(ProductId);
GridTextColumn ProductName2;
ProductName2 = new GridTextColumn()
{
MappingName = "ProductName2",
};
_columns.Add(ProductName2);
GridNumericColumn SalesID2;
SalesID2 = new GridNumericColumn()
{
MappingName = "SalesID2",
};
_columns.Add(SalesID2);
return _columns;
} |