New to Telerik UI for WinForms? Download free 30-day trial

Grouping

RadTreeMap supports grouping for its data items combining the pieces belonging to the same group with a similar color/palette.

When using unbound mode, it is necessary to add a TreeMapDataItemGroup specifying the group Text and LegendTitle. Then, specify the Group property for each TreeMapDataItem. The group items can be added either at design time via the TreeMapDataItemGroup Collection Editor or at run time. Read more in the following help article: Unbound Mode.

Adding Groups at Design Time

winforms-treemap-grouping 001

When using bound mode, once the RadTreeMap is populated with data, it is possible to add a new GroupDescriptor to the GroupDescriptors collection:

RadTreeMap with no grouping

winforms-treemap-grouping 002

RadTreeMap grouped by CategoryID

winforms-treemap-grouping 003

this.radTreeMap1.DisplayMember = "ProductName";
this.radTreeMap1.ValueMember = "ProductID";
this.radTreeMap1.DataSource = this.productsBindingSource;
this.radTreeMap1.GroupDescriptors.Add(new TreeMapGroupDescriptor("CategoryID"));


Me.radTreeMap1.DisplayMember = "ProductName"
Me.radTreeMap1.ValueMember = "ProductID"
Me.radTreeMap1.DataSource = Me.productsBindingSource
Me.radTreeMap1.GroupDescriptors.Add(New TreeMapGroupDescriptor("CategoryID"))

See Also

In this article