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

Applying the styles to nodes based on nodes level

3 Answers 47 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Balaji
Top achievements
Rank 1
Balaji asked on 20 Jul 2009, 06:44 AM
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

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Jul 2009, 07:13 AM
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.
0
Balaji
Top achievements
Rank 1
answered on 20 Jul 2009, 12:27 PM
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.
0
Atanas Korchev
Telerik team
answered on 20 Jul 2009, 12:31 PM
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.
Tags
TreeView
Asked by
Balaji
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Balaji
Top achievements
Rank 1
Share this question
or