GridView isn't alive when loaded with reflection

3 posts, 1 answers
  1. Pituah
    Pituah avatar
    2 posts
    Member since:
    Dec 2015

    Posted 17 Jul Link to this post

    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:

  2. Answer
    Martin Vatev
    Martin Vatev avatar
    76 posts

    Posted 20 Jul Link to this post

    Hello Pituah,

    For your convenience, I modified the referred 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. 

    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.
  3. DevCraft banner
  4. Pituah
    Pituah avatar
    2 posts
    Member since:
    Dec 2015

    Posted 26 Jul in reply to Martin Vatev Link to this post

    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.
Back to Top