Hi, I would like to connect my Web.sitemap to the treeview component and use custom attributes in my sitemap for the DataTextField and DataValueField, is this possible?
Using default attributes from Web.sitemap works fine, ex:
RadTreeView1.DataSource = SiteMapDataSource1;
RadTreeView1.DataTextField = "title";
RadTreeView1.DataValueField = "url";
How do I set the DataTextField to a custom attribute named "pageTitle"? I can't figure out how to get access to it.
Edit: I found the solution from a older version, just had to rewrite it a little. Here's the solution:
protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
{
SiteMapNode siteMapNode = (SiteMapNode)e.Node.DataItem;
e.Node.Text = siteMapNode["pageTitle"];
}
Using default attributes from Web.sitemap works fine, ex:
RadTreeView1.DataSource = SiteMapDataSource1;
RadTreeView1.DataTextField = "title";
RadTreeView1.DataValueField = "url";
How do I set the DataTextField to a custom attribute named "pageTitle"? I can't figure out how to get access to it.
Edit: I found the solution from a older version, just had to rewrite it a little. Here's the solution:
protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
{
SiteMapNode siteMapNode = (SiteMapNode)e.Node.DataItem;
e.Node.Text = siteMapNode["pageTitle"];
}