KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have 3 datagrids that share the same data type. I'd like to configure the column binding once and have the 3 datagrids share the resource. e.g. <DataGrid Grid.Row="1" x:Name="primaryDG" ItemsSource="{Binding Path=dgSource AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Width="Auto" Header="Column 1" Binding="{Binding Path=Col1}"/> <DataGridTextColumn Width="Auto" Header="Column 2" Binding="{Binding Path=Col2}"/> <DataGridTextColumn Width="Auto" Header="Column 3" Binding="{Binding Path=Col3}"/> <DataGridTextColumn Width="Auto" Header="Column 4" Binding="{Binding Path=Col4}"/> </DataGrid.Columns> </DataGrid> Is there a way to set the ItemsSource for each DataGrid, then use a datatemplate or controltemplate to get the columns?
Tags (comma-separated)
Save Edits
Cancel