+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / CategoriesTree properties don't seem to work

CategoriesTree properties don't seem to work

5 posts, 1 answered
  1. Cristian Grisolia
    Cristian Grisolia avatar
    6 posts
    Registered:
    04 Sep 2009
    09 Sep 2009
    Link to this post
    Dear Sirs,
    From back-end administration we're trying to change some CategoriesTree > CategoriesTreeView (Telerik.Web.UI.RadTreeView) properties appearence, but when applying changes and publishing, theese new settings don't have any effect on front-end. The properties are:

    CssClass = [My Css Class]
    EnableEmbeddedBaseStylesheet = False (here we are expecting not to see any WebResource.asxd css reference, but it is always there)

    Are we missing something here??

    Thanks in advance

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Sep 2009
    Link to this post
    Hi Cristian Grisolia,

    The properties you are trying to set applies to the wrapped control- RadTreeView. I say the problem. I would like to suggest the following workarounds.

    1 option: Use CategoriesTree  CssClass property to style the control.
    2 option: Create a CustomControl that inherits from CategoriesTree and set the properties under InitializeControls method. You can find the code below:

    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Web; 
    using Telerik.Cms.Engine.WebControls.Categories; 
    using Telerik.Web.UI; 
    using System.ComponentModel; 
     
    /// <summary> 
    /// Summary description for CustomCategoriesTree 
    /// </summary> 
    public class CustomCategoriesTree :CategoriesTree 
        public CustomCategoriesTree() 
        { 
     
        } 
        public override string LayoutTemplatePath 
        { 
            get 
            { 
                return "~/Sitefinity/ControlTemplates/Generic_Content/CategoriesTree.ascx"
            } 
        } 
       
     
        protected override void InitializeControls(System.Web.UI.Control controlContainer) 
        { 
            base.InitializeControls(controlContainer); 
            this.CategoriesTreeView.CssClass = "MyCss"
            this.CategoriesTreeView.EnableEmbeddedBaseStylesheet = false
        } 

    3 option: Map CategoriesTree.ascx template and change the RadTreeView control properties declaretively.

    We updated your telerik points. We are sorry for the inconvenience caused.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Cristian Grisolia
    Cristian Grisolia avatar
    6 posts
    Registered:
    04 Sep 2009
    10 Sep 2009
    Link to this post
    Hi Ivan,
    we've made the change in order to implement your suggestion (option nmbr 2)
    the thing is that the RadTreeView still doesn't get properly our css class
    Bellow my custom control code behind:

    using System;  
    using System.Collections.Generic;  
    using System.Linq;  
    using System.Web;  
    using Telerik.Cms.Engine.WebControls.Categories;  
    using Telerik.Web.UI;  
    using System.ComponentModel;   
     
    namespace Telerik.Samples.Products.WebControls  
    {  
        public class ProductsCategoriesTree:CategoriesTree  
        {  
            public ProductsCategoriesTree()  
            { }  
     
            public override string LayoutTemplatePath  
            {  
                get 
                {  
                    return "~/UserControls/_templates/Products/CategoriesTree.ascx";  
                }  
            }  
              
     
            protected override void InitializeControls(System.Web.UI.Control controlContainer)  
            {  
                base.InitializeControls(controlContainer);  
                this.CategoriesTreeView.CssClass = "RadTabStrip_SitefinityCompany";  
                this.CategoriesTreeView.EnableEmbeddedBaseStylesheet = false;  
            }   
     
        }  
    }  
     
      

    Here the partial generated markup output:

    <span id="ctl00_SideBarContent_ProductsCategoriesTree1">  
       
    <h3> 
          
    </h3> 
       
    <div id="ctl00_SideBarContent_ProductsCategoriesTree1_ctl00_ctl00_categoriesTreeView" 
        
    class="RadTreeView RadTreeView_Default RadTabStrip_SitefinityCompany">  
        <ul class="rtUL">  
            <li class="rtLI"><div class="rtMid">  
                <span class="rtSp"></span><a class="rtIn" href="/en/App_Master/?ProductsCatID=40ea4a24-30eb-47cf-8187-3aecb6f2236a">Gildemeister (1)</a> 
            </div></li><li class="rtLI"><div class="rtMid">  
                <span class="rtSp"></span><a class="rtIn" href="/en/App_Master/?ProductsCatID=12cbe446-e713-4b25-a70c-b8df8b85a40b">Index (2)</a> 
            </div></li>  
        </ul><input id="ctl00_SideBarContent_ProductsCategoriesTree1_ctl00_ctl00_categoriesTreeView_ClientState" name="ctl00_SideBarContent_ProductsCategoriesTree1_ctl00_ctl00_categoriesTreeView_ClientState" type="hidden" /> 
    </div> 
    </span> 
     

    As you can see there is still RadTreeView RadTreeView_Default css reference in class attribute of div element for the RadTreeView generated html and we can't get rid of the WebResource reference.

    Thanks for the support
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Sep 2009
    Link to this post
    Hi Cristian Grisolia,

    _Default is the name of the skin. You can set Skin="" - empty string. However, you cannot disable RadTreeView RadTreeView_ classes. If you do not set any classes for them there will not affect the styling of RadTreeView control.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  5. Cristian Grisolia
    Cristian Grisolia avatar
    6 posts
    Registered:
    04 Sep 2009
    10 Sep 2009
    Link to this post
    Ok, we could finaly make it work
    Thanks
Register for webinar
5 posts, 1 answered