Hi,
I am running telerik asp.net ajax 2012.2.912.40 for VS 2012.
I see lots of documentation for RadTreeView that does not apply to the version I
am working with.
I need to either use ImageURL to show a line or a method call to show
this line.
Have already tried .Toggle(). Don't wan't to show a '-' image.
Where are the /TreeView images located and/or what method can I call
to show the line?
I am running telerik asp.net ajax 2012.2.912.40 for VS 2012.
I see lots of documentation for RadTreeView that does not apply to the version I
am working with.
I need to either use ImageURL to show a line or a method call to show
this line.
Have already tried .Toggle(). Don't wan't to show a '-' image.
Where are the /TreeView images located and/or what method can I call
to show the line?
5 Answers, 1 is accepted
0

MasterChiefMasterChef
Top achievements
Rank 2
answered on 16 Jan 2013, 04:12 PM
Hi Gerald,
I'm not exactly sure what you're asking. Do you want the lines visible or not? If you would like to change this option, all you need is to set the ShowLineImages value to true or false. As for importing images into your RadTreeView, each node can be set to an image by adding an ImageUrl field. Here is an example where I am removing the lines and adding an image to each parent node.
Hopefully my example could be of some help to you.
Good luck,
Bart
I'm not exactly sure what you're asking. Do you want the lines visible or not? If you would like to change this option, all you need is to set the ShowLineImages value to true or false. As for importing images into your RadTreeView, each node can be set to an image by adding an ImageUrl field. Here is an example where I am removing the lines and adding an image to each parent node.
<
telerik:RadTreeView
ID
=
"RadTreeView1"
Runat
=
"server"
ShowLineImages
=
"False"
Skin
=
"WebBlue"
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Fruit"
ImageUrl
=
"http://upload.wikimedia.org/wikipedia/commons/6/68/Treeview-grey-horizontal-line.png"
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Grapes"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Strawberries"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Watermelon"
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Vegetables"
ImageUrl
=
"http://upload.wikimedia.org/wikipedia/commons/6/68/Treeview-grey-horizontal-line.png"
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Onions"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Peppers"
ImageUrl
=
"http://upload.wikimedia.org/wikipedia/commons/6/68/Treeview-grey-horizontal-line.png"
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Green"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Red"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Jalapeno"
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
BackColor
=
"White"
ImageUrl
=
"http://upload.wikimedia.org/wikipedia/commons/6/68/Treeview-grey-horizontal-line.png"
Text
=
"Candy"
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Twizzlers"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Hershey's Chocolate"
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeView
>
Hopefully my example could be of some help to you.
Good luck,
Bart
0

Gerald
Top achievements
Rank 1
answered on 28 Jan 2013, 06:38 PM
Hi Bart,
Thanks for the reply.
I have seen the 'ShowLineImages' functionality already, i want to show the line in all scenarios.
The functionality that I want to have is to not show the [-] image nor the [+] if there are no child elements and
ONLY show the line image.
I tried
only to have the text and node itself disappear. I want to remove the .css style that shows the [-] image.
Thanks for the reply.
I have seen the 'ShowLineImages' functionality already, i want to show the line in all scenarios.
The functionality that I want to have is to not show the [-] image nor the [+] if there are no child elements and
ONLY show the line image.
I tried
nodeDA.Attributes["style"] ="visibility:hidden;display:none";
only to have the text and node itself disappear. I want to remove the .css style that shows the [-] image.
0

Princy
Top achievements
Rank 2
answered on 29 Jan 2013, 06:36 AM
Hi Gerald
Try the following CSS to hide the minus image of RadTreeView
CSS
Thanks,
Princy.
Try the following CSS to hide the minus image of RadTreeView
CSS
<style type=
"text/css"
>
.RadTreeView_Default .rtMinus
{
background-image
:
none
!important
;
}
</style>
Thanks,
Princy.
0

Gerald
Top achievements
Rank 1
answered on 30 Jan 2013, 09:26 PM
Hi Princy,
I tried using this from code behind in the _NodeExpand event:
RadTreeNode nodeDA = new RadTreeNode("DetailAccounts');
nodeDA.CssClass = "RadTreeView_Default"
But did not work.
I tried using this from code behind in the _NodeExpand event:
RadTreeNode nodeDA = new RadTreeNode("DetailAccounts');
nodeDA.CssClass = "RadTreeView_Default"
But did not work.
0
Hello Gerald,
As far as I understand your scenario, you are trying to remove the plus/minus sign when there are no child nodes of a node in the RadTreeView. In general this is the appearance of the control by design. Here is an example that demonstrates that:
Can you clarify if there is anything that is different in your scenario?
Kind regards,
Kate
the Telerik team
As far as I understand your scenario, you are trying to remove the plus/minus sign when there are no child nodes of a node in the RadTreeView. In general this is the appearance of the control by design. Here is an example that demonstrates that:
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Ticket"
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Ticket"
>
<
Nodes
>
</
Nodes
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Equipment Request"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Help Desk Question"
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Equipment Request"
>
</
telerik:RadTreeNode
>
<
telerik:RadTreeNode
runat
=
"server"
Text
=
"Help Desk Question"
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeView
>
Can you clarify if there is anything that is different in your scenario?
Kind regards,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.