
khaled jendi
Top achievements
Rank 1
khaled jendi
asked on 16 Aug 2010, 10:54 AM
I am looking to change style for treeview which has office 2007, the matter is that I wanna change the expand/collapse button (the small + or - sign) to something triangle shape (as windows 7 skin), so how to do that?
and I want when I click to child root, the parent root should be highlighted in same effect as child...
he is how the changing should be (I have drawn then in photoshop):
and I want when I click to child root, the parent root should be highlighted in same effect as child...
he is how the changing should be (I have drawn then in photoshop):
5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 16 Aug 2010, 12:17 PM
Hello Khaled,
By using following CSS, you can change the images for expand/collapse.
Style:
And to hightlight the parent node, use the following client code.
client code:
Thanks,
Princy.
By using following CSS, you can change the images for expand/collapse.
Style:
<style type=
"text/css"
>
.rtPlus
{
background-image
:
url
(
'../Images/Cancel.gif'
)
!important
;
background-position
:
0px
0px
!important
;
}
.rtMinus
{
background-image
:
url
(
'../Images/Edit.gif'
)
!important
;
background-position
:
0px
0px
!important
;
}
</style>
And to hightlight the parent node, use the following client code.
client code:
<script type=
"text/javascript"
>
function
OnClientNodeClicked(sender, args) {
var
node = args.get_node();
if
(node.get_level() != 0) {
var
parentNode = node.get_parent();
parentNode.highlight();
}
}
</script>
Thanks,
Princy.
0

khaled jendi
Top achievements
Rank 1
answered on 16 Aug 2010, 08:07 PM
thanks very much,
when I select a child I get the highlight, but if I move to another child from another root, I got a problem here, because the old root is kept selected, I need to get the all the elements of tree and deselect them one by one, a better solution is that if I can save the selected root in hidden input tag, would be really better for browser and faster, and less processing...
kindly, see the first image
one more thing is that, I wanna same triangle of windows 7, I can get it from firebug, but how may I use it?
kindly, see the other image
when I select a child I get the highlight, but if I move to another child from another root, I got a problem here, because the old root is kept selected, I need to get the all the elements of tree and deselect them one by one, a better solution is that if I can save the selected root in hidden input tag, would be really better for browser and faster, and less processing...
kindly, see the first image
one more thing is that, I wanna same triangle of windows 7, I can get it from firebug, but how may I use it?
kindly, see the other image
0
Accepted
Hello Khaled,
Use these CSS and javascript instead:
<style type="text/css">
div.RadTreeView .rtPlus,
div.RadTreeView .rtPlus:hover,
div.RadTreeView .rtPlusHover,
div.RadTreeView .rtMinus,
div.RadTreeView .rtMinus:hover,
div.RadTreeView .rtMinusHover
{
background-image: url('images/PlusMinus.png');
}
</style>
<script type="text/javascript">
function OnClientNodeClicked(sender, args) {
$telerik.$('.rtSelected', sender.get_element()).removeClass('rtSelected');
for (var node = args.get_node(); node._parent && node.get_level() >= 0; node = node.get_parent())
$telerik.$(node.get_contentElement()).addClass('rtSelected');
}
</script>
I'm attaching the Windows7 plus/minus image sprite which should go in images/
Regards,
Kamen Bundev
the Telerik team
Use these CSS and javascript instead:
<style type="text/css">
div.RadTreeView .rtPlus,
div.RadTreeView .rtPlus:hover,
div.RadTreeView .rtPlusHover,
div.RadTreeView .rtMinus,
div.RadTreeView .rtMinus:hover,
div.RadTreeView .rtMinusHover
{
background-image: url('images/PlusMinus.png');
}
</style>
<script type="text/javascript">
function OnClientNodeClicked(sender, args) {
$telerik.$('.rtSelected', sender.get_element()).removeClass('rtSelected');
for (var node = args.get_node(); node._parent && node.get_level() >= 0; node = node.get_parent())
$telerik.$(node.get_contentElement()).addClass('rtSelected');
}
</script>
I'm attaching the Windows7 plus/minus image sprite which should go in images/
Regards,
Kamen Bundev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Ali
Top achievements
Rank 1
answered on 14 Jan 2011, 12:46 PM
Hi,
I am using a Custom Skin.
Can you please provide me the sprite image for my attached plus minus.
I am not getting the similar look and feel same as that of Telerik Skin.
Do I need to change the css and javascript inorder to achieve the similar behavior as that of the PlusMinus Image of Telerik Skin?
Thanks
I am using a Custom Skin.
Can you please provide me the sprite image for my attached plus minus.
I am not getting the similar look and feel same as that of Telerik Skin.
Do I need to change the css and javascript inorder to achieve the similar behavior as that of the PlusMinus Image of Telerik Skin?
Thanks
0
Hi Ali,
You can change the plus/minus images with the following css styles:
You can find the image attached.
All the best,
Yana
the Telerik team
You can change the plus/minus images with the following css styles:
<style type=
"text/css"
>
div.RadTreeView .rtPlus,
div.RadTreeView .rtMinus
{
background
:
#fff
url
(
'plusminus.png'
)
0
0
;
}
div.RadTreeView .rtMinus
{
background-position
:
0
-11px
;
}
</style>
You can find the image attached.
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.