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

Custom RadTreeView control to remove the default classes

3 Answers 134 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Peter Livsey
Top achievements
Rank 1
Peter Livsey asked on 10 Feb 2012, 11:47 AM
I want to remove the default classes RadTreeView RadTreeView_Default. so that the containing div of the treeview does not have class="RadTreeView RadTreeView_Default". I have created a custom control that inherits from RadTreeView and in there I am overriding the CssClassFormatString property and returning an empty string.

When I use this custom class is my control the 'class="RadTreeView RadTreeView_Default"' is removed, but treeview no longer shows the boxes to expand the tree after the first level which I am expanding in code.  The html source shows all of the additional levels are still being generated.

Is there something that I need to set to maintain the expanding nodes, or is there an easier way to remove the default classes without creating a custom control that inherits the RadTreeView?

Thanks
Peter

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 14 Feb 2012, 05:27 PM
Hi Peter,

 
If you want to store the expanded state of the nodes you can refer to this Code Library.

Hope this will be helpful.

All the best,
Plamen Zdravkov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Peter Livsey
Top achievements
Rank 1
answered on 17 Feb 2012, 09:12 AM
What I am trying to do is find a way to override the default styling on the treeview so that our designers can customise it's appearance.  I'm using the treeview control within a aspx page on a Sharepoint website.  Using the standard control the treeview works but we're unable to override the styling.  I was trying to inherit the telerik treeview and remove the default class and css for the treeview but doing that broke the tree. 

What is the best way to override the default css styling on the treeview?
0
Plamen
Telerik team
answered on 21 Feb 2012, 04:52 PM
Hi Peter,

 
I may recommend you to use different cssClass properties as shown in this demo

As for overriding any RadControl default styles - we do not recommend this approach, as it may break their inner layout logic. In addition, Telerik does not support customized based stylesheets as they differ enough from ours.

All the best,
Plamen Zdravkov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TreeView
Asked by
Peter Livsey
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Peter Livsey
Top achievements
Rank 1
Share this question
or