I want to display multiple DataTables with fixed layout(columns are fixed and same for each table). I am using ItemsControls where ItemTemplate is Grid, and my collection of tables is in Dictionary.
My dictionary is dynamic and can change, and number of rows for each table is also dynamic and can change.
So I want to bind ItemsControl to my dictionary, where each Item is Binded to DataTable, and want to display that DataTable.
But I am not able to display any table.
What I have tried:
<ItemsControl ItemsSource="{Binding allGroup}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DataGrid ItemsSource="{Binding Value.DefaultView, Mode=OneWay}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
public partial class MainWindow : Window
{
Dictionary<string, DataTable> allGroup = new Dictionary<string, DataTable>();
public MainWindow()
{
InitailizeComponent;
}
}
I have added some tables into dictionary(allGroup) but can't see anything when running application.