We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to populate the TreeMap data values by using the DataTable?

The following steps help you to populate the TreeMap data values by using the DataTable.

Step 1: Add the data of columns and rows to the DataTable as given in the following code. In the code, five columns are added such as Continent, Country, Growth, Population and StrPopulation and values included for the respective columns.

C#

Step 2: Assign data values to the ItemsSource property in order to populate the provided TreeMap items.

C#

In the following code example, DataTable has been created under the PopulationViewModel() by adding the necessary columns and rows. Column data denotes TreeMap header and row data denotes corresponding values for the TreeMap header. Assign the PopulationDetails data to the ItemsSource of the TreeMap in order to render the TreeMap control.

C#

The following screenshot displays the TreeMap items populated by using the DataTable.

Figure 1: Populating TreeMap items by using DataTable

Sample Link:

CustomColorMapping.zip

Article ID: Published Date: Last Revised Date: Platform: Control:
4244 03/05/2015 03/05/2015 Windows Forms TreeMap
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.