TreeMap - Programmatic DataBinding

IEnumerable

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

To bind RadTreeMap programmatically, take the following steps in in the code-behind:

  • Set the DataSource property. This property points a data source such as a DataSet, DataTable, DataReader, ArrayList, etc.
  • Call the DataBind method on page load.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="TreeMap.Functionality.Programatic.DefaultCS"Language="c#"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container no-bg">
        <p>IEnumerable</p>
        <telerik:RadTreeMap RenderMode="Lightweight" runat="server" ID="TreeMap1" DataFieldID="ID" DataFieldParentID="ParentID" DataTextField="Text" DataValueField="Value">
        </telerik:RadTreeMap>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?