Custom RadTreeView control to remove the default classes

4 posts, 0 answers
  1. Peter Livsey
    Peter Livsey avatar
    44 posts
    Member since:
    Aug 2012

    Posted 10 Feb 2012 Link to this post

    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
  2. Plamen
    Admin
    Plamen avatar
    3056 posts

    Posted 14 Feb 2012 Link to this post

    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 >>
  3. Peter Livsey
    Peter Livsey avatar
    44 posts
    Member since:
    Aug 2012

    Posted 17 Feb 2012 Link to this post

    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?
  4. Plamen
    Admin
    Plamen avatar
    3056 posts

    Posted 21 Feb 2012 Link to this post

    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 >>
Back to Top