I have two ObservableCollection
List1 = new ObservableCollection<ManagementFunctionModel>();
List2 = new ObservableCollection<ManagementFunctionModel>();
Both these lists have their own data. In my xaml, is it possible to bind my Datagrid to two the two different lists? Ideally I want to bind List1 on button1click and List2 on button2click. My xaml is below
<DataGrid Name="grid" HorizontalAlignment="Stretch" ItemsSource="{Binding List1}" Margin="0,0,0,50" VerticalAlignment="Stretch" AutoGenerateColumns="False" CanUserAddRows="False">
<DataGrid.Columns>
...
...
</DataGrid.Columns>
</DataGrid>
Itemsourcein the code-behind in the click-handlers?