3 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 21 May 2009, 09:57 AM
Hi Patxi,
You can use the ImageUrl property to set the image for RadTreeNode.
ASPX:
Checkout the online demo which illustrates the feature.
TreeView / Custom Attributes
-Shinu.
You can use the ImageUrl property to set the image for RadTreeNode.
ASPX:
<telerik:RadTreeView ID="RadTreeView1" runat="server"> |
<Nodes> |
<telerik:RadTreeNode runat="server" Text="Node1" CategoryOf="Car" ImageUrl="../Images/Car1.gif"> |
<Nodes> |
<telerik:RadTreeNode Text="Child Node" ImageUrl="../Images/Car2.gif"></telerik:RadTreeNode> |
</Nodes> |
. . . |
</Nodes> |
</telerik:RadTreeView> |
Checkout the online demo which illustrates the feature.
TreeView / Custom Attributes
-Shinu.
0
Patxi
Top achievements
Rank 1
answered on 21 May 2009, 10:38 AM
Thank you Shinu.
I forgot to add one thing. Your answer is valid in my case for child nodes. All child nodes will have the same image. For parent nodes I would like to do something different. I want them to have a closed folder when its child nodes are not shown and an open folder when child nodes are visible for the user.
do you have any example for this?
I forgot to add one thing. Your answer is valid in my case for child nodes. All child nodes will have the same image. For parent nodes I would like to do something different. I want them to have a closed folder when its child nodes are not shown and an open folder when child nodes are visible for the user.
do you have any example for this?
0
Accepted
Princy
Top achievements
Rank 2
answered on 21 May 2009, 11:17 AM
Hi Patxi,
Set the ExpandedImageUrl proprty of the nodes to set the value specifying the URL of the image (opened folder image) rendered when the node is expanded.
.aspx:
<telerik:RadTreeView ID="RadTreeView1" runat="server"> |
<Nodes> |
<telerik:RadTreeNode runat="server" Text="RadTreeNode1" ExpandedImageUrl="../Images/OpenedFolder.gif" ImageUrl="../Images/Closedfolder.gif"> |
<Nodes> |
<telerik:RadTreeNode Text="RadTreeNode2" ExpandedImageUrl="../Images/OpenedFolder.gif" ImageUrl="../Images/Closedfolder.gif"> |
</telerik:RadTreeNode> |
</Nodes> |
. . . |
</Nodes> |
</telerik:RadTreeView> |
Thanks,
Princy.