Click here to Skip to main content
12,952,112 members (58,248 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I have scenario which binds the Brand, category and sub categories in a treeview dynamically. I have separate styles for RootNode - Brand, ParentNode - Category and ChildNode- SubCategory. Parent Node and Root node should not be clicked only child nodes can be clicked. All this works fine but I have also a scenario that a Category may not have sub category but it should have parent node style and it can be clicked also. I am not able to do this.

Ex: Brand1

In the above example Brand1,Category1 and Category2 should not be clickable whereas only subcategories can be clicked and Category that does not have any subcategory can also be clicked. Brand1 - should have one style and all the main categories should have one style and all the sub categories should have one style.
Posted 5-Jul-12 3:14am
John Orendt 5-Jul-12 23:01pm
You mean only nodes with no children are clickable?
Beula Joyce 6-Jul-12 0:18am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You have to use
function of jQuery.
Check this jQuery API link[^] for demos.
Just try to add your logic and use this function.
And let me know whether you complete it or not.
Please post your test codes and logic using
, so that I can help you. :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I have solved it by myself. I have created the treeview controls at runtime and that solved my problem.

Thank you all for your support
Tadit Dash 6-Jul-12 6:19am
That's sounds nice. As you are doing it in client side before, so I posted one solution.... Anyway great job... :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 6 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100