New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
NodeDataBound
The NodeDataBound fires for every Node that is bound to data. Use the RadTreeNodeEventArgs to access the properties of the bound Node. Use the Node's DataItem property to access the underlying object or data row being bound to.
Binding to a database:
C#
protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
{
e.Node.ToolTip = (e.Node.DataItem as DataRowView)["Description"].ToString();
}
Binding to XML datasource:
C#
protected void RadTreeView_OnNodeDataBound(object sender, RadTreeNodeEventArgs e)
{
XmlElement element = (XmlElement)e.Node.DataItem;
e.Node.ToolTip = element.GetAttribute("ToolTip");
e.Node.Attributes["NodeType"] = element.GetAttribute("NodeType");
e.Node.Attributes["LevelID"] = element.GetAttribute("LevelID");
}