Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

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
       Category1
           subCategory1.1
           subCategory1.2
       Category2
           subCategory2.1
           subCategory2.2
       Category3
       Category4
       Category5


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
Comments
John Orendt 5-Jul-12 23:01pm    
You mean only nodes with no children are clickable?
Beula Joyce 6-Jul-12 0:18am    
yes

You have to use
HTML
.find()
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
HTML
.find()
, so that I can help you. :)
 
Share this answer
 
Hi,
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
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900