Updates to ObservableCollection not handled

4 posts, 0 answers
  1. Marc
    Marc avatar
    6 posts
    Member since:
    Sep 2011

    Posted 03 Oct 2011 Link to this post

    We are databinding the ItemsSource property of the RadPivotMap to a property in our viewmodel of type ObservableCollection<> 
    If we set this property to a new value, the propertychanged event is triggered and the pivotmap is updated.
    However adding/deleting items to/from the ObservableCollection does not trigger an update of the pivotmap.

    This seems like a bug in the pivotmap-control as everything works correctly if we bind another control to the same collection.
  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 04 Oct 2011 Link to this post

    Hello Marc,

    We investigated PivotMap behavior in collection update scenarios and found out that when a completely new category is being added the PivotMap doesn't respond correctly. Our developers are currently working on a solution to this problem and it will be released with the next major version. You can workaround this by making the pivotmap rebind itself like this:

    var item = new TestData()
    {
        Category = "D",
        Subcategory = "D1",
        Value = 50
    };
    bool isNewCategory = !this.data.Any(c => c.Category == "D");
    this.data.Add(item);
     
    // workaround
    if (isNewCategory)
    {
        this.treeMap1.ItemsSource = null;
        this.treeMap1.ItemsSource = this.data;
    }

    I have created a small app that demonstrates the different scenarios that you can face when updating your collection. Please examine it and let us know if the proposed workaround doesn't work for you.

    Best wishes,
    Yavor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Marc
    Marc avatar
    6 posts
    Member since:
    Sep 2011

    Posted 10 Oct 2011 Link to this post

    Hello Yavor,

    You're right about the behavior of the pivotmap. The bug only appears on adding a new category, we didn't notice that before.
    We had a similar workaround already in place and that's working fine for now. Of course it would however be nice if the bug will be removed from future versions...

    Thanks for the quick response, sorry that I was not able to verify your comments earlier.

    Kind regards, Marc.
  5. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 10 Oct 2011 Link to this post

    Hi Marc,

    I am happy to announce that our developers were able to fix this problem last weak and you can get the fix with the next LIB. It will be available for download from your account later today.

    All the best,
    Yavor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top