4 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 18 Apr 2012, 07:35 AM
Hi Issac,
I suppose that you want to redirect to a URL while clicking on the image. I can achieve this by adding a ImageButton to the NodeTemplate of the RadTreeNode and from the onclick event of that ImageButton I can redirect to the other page as follows.
ASPX:
C#:
Hope this helps.
Thanks,
Princy.
I suppose that you want to redirect to a URL while clicking on the image. I can achieve this by adding a ImageButton to the NodeTemplate of the RadTreeNode and from the onclick event of that ImageButton I can redirect to the other page as follows.
ASPX:
<telerik:RadTreeView ID="RadTreeView1" runat="server"> <Nodes> <telerik:RadTreeNode runat="server" Text="a1" Value="A"> <NodeTemplate> <asp:ImageButton ID="lnk" runat="server" Text="lnk" onclick="lnk_Click" ImageUrl="~/Images/image.jpg" /> </NodeTemplate> </Nodes></telerik:RadTreeView>C#:
protected void lnk_Click(object sender, EventArgs e) { Response.Redirect("url"); }Hope this helps.
Thanks,
Princy.
0
Issac
Top achievements
Rank 1
Iron
answered on 18 Apr 2012, 02:30 PM
I am populating the TreeView from code.
There is no way to attached myLink to the image? javascript?
Dim lstSelected As RadTreeNode = New RadTreeNode(cCategory , "", myLink)lstSelected.ImageUrl = "images/btns/delbtn.gif"lstSelected.ToolTip = "Click to Remove Category" + cCategory + " From Your Selection"lstYourSelection.Nodes.Add(lstSelected)There is no way to attached myLink to the image? javascript?
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 Apr 2012, 11:01 AM
Hi Issac,
Try giving your link in the NodeClick event.
ASPX:
C#:
Thanks,
Princy
Try giving your link in the NodeClick event.
ASPX:
<telerik:RadTreeView ID="lstYourSelection" runat="server" OnNodeClick="lstYourSelection_NodeClick"></telerik:RadTreeView>C#:
protected void lstYourSelection_NodeClick(object sender, RadTreeNodeEventArgs e) { Response.Redirect("url"); }Thanks,
Princy
0
Issac
Top achievements
Rank 1
Iron
answered on 19 Apr 2012, 01:56 PM
Thank you Princy, that worked perfectly.