This is a migrated thread and some comments may be shown as answers.

Possible to prevent RadTreeView from navigating when bound to SiteMapDataSource?

1 Answer 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 11 Jan 2011, 05:05 PM
Hi all,

I have a RadTreeView which I'm binding to a SiteMapDataSource. When I click on a node, it navigates to the page URL in the SiteMap. Normally, this would likely be the behavior that one would want. However, in my case, I'm trying to use the control to allow the user to modify the tree. I don't want the control to navigate to the URL corresponding to the node when the user clicks on the node. I just want them to select the node. Does anyone know if there is a way to prevent it from navigating? I'm guessing I'm running into this problem since I'm binding to a SiteMapDataSource. I was thinking maybe I could set a Handled property on the EventArgs to the NodeClick event to override the navigation, but, it doesn't look like that is supported.

<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<telerik:RadTreeView ID="RadTreeView1" runat="server" 
    DataSourceID="SiteMapDataSource1" Height="200px" 
    onnodeclick="RadTreeView1_NodeClick">
</telerik:RadTreeView>

Jon

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 12 Jan 2011, 03:02 PM
Hi Jon,

You can subscribe to OnNodeDataBound event of the treeview and set NavigateUrl property to "#" in order to avoid the navigation.

All the best,
Yana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
TreeView
Asked by
Jon
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or