Table View Control used with MVVM Pattern

Jul 31, 2012 at 5:34 AM

Great work mate!

Do you have any example of Table View Control bound to View Model using Caliburn Micro or some other Automatic Binding Framework?

My requirement is to bind Column Titles and the left most column of the Row (as a Row Legend) and handle click event of each cell to modify property in View Model.

I also need to develop the Context Menu for the Table View as well.

I will be working on this may be around next week but if  you have any example to start with where you are binding the Table View with View Model and performing some basic example, would help me.

Coordinator
Jul 31, 2012 at 3:40 PM

Probably not going to be of much help, I've never used Caliburn micro so I can't advise there.

If you can find examples of the WPF DataGrid and Caliburn then the concepts there should translate to Tableview reasonably easily.

Your other requirements should be fine, Column Titles can be bound in the xaml or on the fly in the code behind if you are generating the columns at runtime.

I would probably use data templates for the rows so that you can handle the click events through commands.

The Context Menu is very straight forward 

            <tv:TableView.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Hello" Command="{Binding HelloCommand}"/>
                    <MenuItem Header="World" Command="{Binding WorldCommand}"/>
                </ContextMenu>
            </tv:TableView.ContextMenu>

Just add something like the above to the tableview xaml and implement some commands for the menuitems