DataGrid row and MVVM
Posted
by Titan
on Stack Overflow
See other posts from Stack Overflow
or by Titan
Published on 2010-05-18T06:06:03Z
Indexed on
2010/05/18
6:10 UTC
Read the original article
Hit count: 567
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.
© Stack Overflow or respective owner