RadGridView not refreshing after ItemsSource changes.

6 posts, 0 answers
  1. Rajani
    Rajani avatar
    14 posts
    Member since:
    Feb 2013

    Posted 02 Apr 2013 Link to this post

    I have a RadGridView where the ItemsSource is a DataTable. The user is able to run a query which returns a List of objects which I convert to a DataTable using a WPF Converter .. All the binding is done through XAML.. Everything works very well so far. If the user reruns the query RadGridView gets correctly updated as expected.

    Now the problem is when I add grouping. Rerun the query and now the grid is empty. However if I remove the grouping, all the expected data is displayed on the grid and now if I regroup everything works fine until the ItemsSource on the grid is changed again (by re-running the query). Any idea why this is happening?

    I tried removing the GroupingDescriptors and re-adding them .. Also tried rebinding when the ItemsSource changed .. both options did not work. What am I missing here?

    Thanks.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Apr 2013 Link to this post

    Hello,

    Have you tried to set the ItemsSource to be the DataTable.DefaultView? 

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Rajani
    Rajani avatar
    14 posts
    Member since:
    Feb 2013

    Posted 04 Apr 2013 Link to this post

    Thank you Didie for your prompt response.

    Yes, I just tried DataTable.DefaultView but that did not help.. Here is the thing, every time I get data back from the server I'm recreating the DataTable  using a converter. Could that be the problem? Converter returns a DataTable (also tried returning DataTable.DefaultView)  ..

    XAML looks like below:

    <telerik:RadGridView.ItemsSource>

    <MultiBinding Converter="{StaticResource CollectionToDataTableConverter}" >

    <Binding Path="UIItems" Mode="TwoWay" />

    <Binding Path="Fields" Mode="TwoWay" />

    </MultiBinding>

    </telerik:RadGridView.ItemsSource>

    I also tried adding an event handler on ItemsSource_Changed and within it removed the groupDescriptor and adding it back .. that also did not help.

  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Apr 2013 Link to this post

    Hello,

    Recreating the DataTable while you have some Grouping applied should not be a problem for the Items to be refreshed. Would it be possible for you to replicate the issue in a simple demo project? You could then open a support thread and send us the solution to check it locally.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Rajani
    Rajani avatar
    14 posts
    Member since:
    Feb 2013

    Posted 05 Apr 2013 Link to this post

    Hi Didie, I have created a quick and dirty demo project repro'ing this issue, however I'm not able to open a support ticket; it says that I'm not a licensed user.  Can you please tell me how I can send you the project? Thanks.
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Apr 2013 Link to this post

    Hello,

    You should be assigned as a licensed user in order to be able to open a support ticket. Please ask the licence holder to add you as such.

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top