Applying the styles to nodes based on nodes level

4 posts, 0 answers
  1. Balaji
    Balaji avatar
    30 posts
    Member since:
    Mar 2008

    Posted 20 Jul 2009 Link to this post

    Hi Telerik,

    I am using ajax rad tree view in our application and it contains nodes in two levels(0,1). There is requirement to show level 0 nodes in one style and level 1 nodes in another. I have tried with custom skin unsuccessfully.

    Could you please suggest me how can I achive this functionality.

    Thanks in advance,
    Balaji Velasiri
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 20 Jul 2009 Link to this post

    Hi Balaji,

    You can check this online example. It shows how to use the DataBindings property in order to format visually the nodes based on their level.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Balaji
    Balaji avatar
    30 posts
    Member since:
    Mar 2008

    Posted 20 Jul 2009 Link to this post

    Hi Albert,

    Thanks for your reply. And I have treid to change the nodes styles using "CssClass" attribute in the RadTreeNodeBinding element.

    But my application is giving following error while buiding the application:
    Validation (ASP.Net): Attribute 'CssClass' is not a valid attribute of element 'RadTreeNodeBinding'.

    And I am using the 2008.2.1001.20  version assembly.

    Thanks,
    Balaji.
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 20 Jul 2009 Link to this post

    Hello Balaji,

    The CssClass property was introduced later than this release. If upgrade is not an option you can manually (from codebehind) set the CssClass property of the nodes. You can use the GetAllNodes method to enumerate all nodes and then the Level property of the node to determine its level.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top