This is a migrated thread and some comments may be shown as answers.

GridView isn't alive when loaded with reflection

2 Answers 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pituah
Top achievements
Rank 1
Pituah asked on 17 Jul 2016, 01:23 PM

General description of the project:
In our project we load MVVM-Architectured windows using C# Reflection and put them onto a RadDockPanel, that way it corresponds with our high demands of flexibility, you can specify which windows you want to load when the program starts or afterwards and also close them mid run without affecting the rest of the loaded windows.

The problem: for some reason when we load MVVM-windows that contain the RadGridView controls, they don't update in accordance to their binded-source.

The attachment contains a very stripped down version of loading a window that contains both, a RadGridView and a regular Microsoft DataGrid both of which are bound to the the same property(ObservableCollection). While the DataGrid is updating on every new Item added, the RadGridView does not. Even when explicitly told to do so using the CollectionChaged event.

Also, there's an attached project (ModuleConsoleStarter) that simply runs the same window not loading it with Reflection. In that project both controls are updating perfectly in accordance with theirs source!

My network security provider doesn't allow me to upload files so here is a Google Drive link:

https://drive.google.com/folderview?id=0B2kbmdtjQ0m_X0Zxajk4bkpiSFk&usp=sharing

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin
Telerik team
answered on 20 Jul 2016, 10:35 AM
Hello Pituah,

For your convenience, I modified the  example to demonstrate how to achieve the desired behavior. Please take a look at the implementation and consider how this approach fits your scenario.

I hope that this helps. 

Regards,
Martin Vatev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Pituah
Top achievements
Rank 1
answered on 26 Jul 2016, 09:55 AM
Thanks for the help,
The only change that i've noticed is that you specifically bind the itemSource in the constructor instead of from the designer code.
It's odd that such specific actions are required to acheive the desired effect and it doesn't bind automatically.
Tags
GridView
Asked by
Pituah
Top achievements
Rank 1
Answers by
Martin
Telerik team
Pituah
Top achievements
Rank 1
Share this question
or