DataGrid row and MVVM
- by Titan
Hi,
I have a wpf datagrid with many rows, each row has some specific behaviors like selection changed of column 1 combo will filter column 2 combo, and what is selected in row 1 column 1 combo cannot be selected in row 2 column 1 combo, etc...
So I am thinking of having a view model for the main datagrid, and another for each row.
Is that a good MVVM implementation? It is so that I can handle each row's change event effectively.
Question is, how do I create "each row" as a user control view? within the datagrid.
I want to implement something like this:
<TreeView
Padding="0,4,12,0">
<controls:CommandTreeViewItem
Header="Sales Orders"
Command="{Binding SelectViewModelCommand}"
CommandParameter="Sales Orders"/>
</TreeView>
Where instead of a TreeView I want a datagrid, and instead of controls:CommandTreeViewItem a datagrid row in WPF.
Thanks in advance.