Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
XamDataGrid and customization
posted

Hello
I am using the WPF XamDataGrid (2010 Volume 2) in some screens, and I have some questions and request for guidelines.

I have started following the MVVM-way of designing my screens. And then I have some issues around loading customizations to the grid.

Because I am using the MVVM-way, I try to have as little codebehind as possible, and base the GUI on bindings to a underlying ViewModel class. In the ViewModel class, I load the customization XML to a public String property.

1) Is there (or will there be) a way to load the customization XML with a property on the grid? Because then I could just bind the customization XML to the ViewModel class instead of using the "loadCustomizatuion()" method.

2) The customization disappears when the parent user control is loaded.
In some cases, I have a TabControl with ex. 3 tabs in it. Each of these tabs have a UserControl with one or more grids in it.

Problem #1 : When I switch between the tabs, the customization on the grid is cleared. So I have to load the customization every time the parent UserControl_Loaded event is fired (the content screen in the TabItem).

Problem #2 : When I try to load the customization with "LoadCustomization()" method on "UserControl_Loaded", I get a thread error.

And I would like to nat have a UserControl_Loaded in the first place because of MVVM. I'd rather bind the customization XML to a XamDataGrid property.

Any suggestions?

Feel free to ask for more details if I have not described scenario as well as I should.

 - Mats Magnem
KSD Software