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

Updates to ObservableCollection not handled

3 Answers 77 Views
TreeMap and PivotMap
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 03 Oct 2011, 09:49 AM
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.

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 04 Oct 2011, 12:56 PM
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 >>

0
Marc
Top achievements
Rank 1
answered on 10 Oct 2011, 08:55 AM
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.
0
Yavor
Telerik team
answered on 10 Oct 2011, 01:00 PM
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 >>

Tags
TreeMap and PivotMap
Asked by
Marc
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Marc
Top achievements
Rank 1
Share this question
or