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

Dynamic DataNavigateUrlField and base url?

3 Answers 113 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jochem Bökkers
Top achievements
Rank 2
Jochem Bökkers asked on 20 May 2010, 03:26 PM
Hi,

I'm using a RadTreeView.DataNavigateUrlField to fetch not a full url from a database but a querystring value. Is it possible to set a 'base-url' instead of the RadTreeView automatically using the current location ?

For Example:
In the database the field 'CategoryId' has the value's 1,2,4,5 and 7.
In the code I'm using  
treeView.DataNavigateUrlField = "CategoryId" 

to bind the database column. Now when I click a node, it shouldn't go to 'http://www.currentlocation.currentdoc.aspx/1' but 'http://www.differentlocation/differentdoc.aspx?CId=1'

Thanks,
Jochem.

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 21 May 2010, 08:27 AM
Hi Jochem,

Try the following code in NodeDataBound event and see whether it helps.

C#:
 
    protected void RadTreeView2_NodeDataBound(object sender, RadTreeNodeEventArgs e)  
    {  
        e.Node.NavigateUrl = "http://www.differentLocation/differentdoc.aspx?Cid="+ e.Node.NavigateUrl.ToString();  
    } 

Regards,
Princy.
0
Jochem Bökkers
Top achievements
Rank 2
answered on 21 May 2010, 09:02 AM
Hey Princy,

It works like a charm, thanks. 
I over looked the OnNodeDatabound and couldn't get the Node.NavigateUrl to work dynamically after rendering.
0
Sandeep Gupta
Top achievements
Rank 2
answered on 17 May 2012, 01:17 PM
Hi,

Thank you this solution.

Thank,
Sandeep Gupta
Team Leader
IDS Logic Pvt Ltd.
Tags
TreeView
Asked by
Jochem Bökkers
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Jochem Bökkers
Top achievements
Rank 2
Sandeep Gupta
Top achievements
Rank 2
Share this question
or