HelloI 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 MagnemKSD Software
Thank you for the replies. I will dive into this. Thank you :-)
I also found this event on the XamDataGrid, which I may use as the event to trigger the layout load: - FieldLayoutInitialized
- Mats MagnemKSD Software AS
Hello Mats,
You can create attached properties to extend the functionality of the XamDataGrid. You can create attached string and boolean properties with which you can bind the customization or check if the customization is saved or not.
Regarding your second issue, you can find more information on it here.