Treeview not working on Widget designer
Hi,
I am using treeview on the widget designer to provide easy selection of pages.
The treeview is rendering all the nodes provided by the site map data source control but it is not showing the title or the urls of the page in the nodes
Moiz Ahmed
Hi Moiz ,
How did you bind the control? You can set all properties of a Node inside NodeDataBound event of the RadTreeView control.
Greetings,
Ivan Dimitrov
the Telerik team
Hi Ivan,
I used the wizard available for the Rad tree view. Everything is on the markup. Earlier I had also tried to use code blocks in this but they didn't seem to work at all.
this is my code that is binding the tree view with the site map, please review and advise
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
DataSourceID
=
"CurrentSiteMap"
DataTextField="Title" DataValueField="Url" DataNavigateUrlField="Url"
Skin="Vista" >
</
telerik:RadTreeView
>
<
asp:SiteMapDataSource
ID
=
"CurrentSiteMap"
runat
=
"server"
/>
Hello Moiz,
Try using the following declaration
<telerik:RadTreeView runat="server" ID="TreeView1" DataSourceID="SiteMap1"></telerik:RadTreeView>
<asp:SiteMapDataSource runat="server" ID="SiteMap1" ShowStartingNode="false" />
This should work fine.
Best wishes,
Ivan Dimitrov
the Telerik team