Version

Data Drill-down

Before You Begin

In this article you will learn how to use xamTreemap™ control’s ItemsSourceRoot property.

The ItemsSourceRoot property allows the user to specify which node of the current DataContext will be set as root.

Creating a Simple Drill-down Application

  1. Create a Microsoft® WPF™ application.

  2. Add an instance of the xamTreemap control to your application.

  3. Handle the NodeMouseLeftButtonDown event:

In XAML:

<ig:xamTreemap
    x:Name="Treemap"
    NodeMouseLeftButtonDown="Treemap_NodeMouseLeftButtonDown">
</ig:xamTreemap>

In Visual Basic:

Private Sub Treemap_NodeMouseLeftButtonDown _
(ByVal sender As Object, ByVal e As TreemapNodeClickEventArgs)
    If Treemap.ItemsSourceRoot <> e.Node.DataContext Then
        Treemap.ItemsSourceRoot = e.Node.DataContext
    End If
End Sub

In C#:

private void Treemap_NodeMouseLeftButtonDown(object sender, TreemapNodeClickEventArgs e)
{
    if (Treemap.ItemsSourceRoot != e.Node.DataContext)
    {
        Treemap.ItemsSourceRoot = e.Node.DataContext;
    }
}
  1. Create custom logic for drilling down and storing the drilled roots.

xamTreemap Data Drill down.png