Solved

Single node in a TreeView without a checkbox

Posted on 2004-10-07
6
678 Views
Last Modified: 2008-02-01
Hi Experts

I have a TreeView control with two main nodes (Parent1 and Parent2), each of which has children, they have children, etc. I have enabled the checkboxes for the TreeView and everything is fine. The only little problem is, that the Parent1 and Parent2 nodes are actually just grouping and the logic is that they cannot be selected. Is it possible that only those two nodes have NO checkboxes, whilst all others have?

Thanks
TheAvenger
0
Comment
Question by:TheAvenger
6 Comments
 
LVL 10

Expert Comment

by:smegghead
ID: 12248858
I've done this in the past, but it's not a very tidy solution.. and I'm sure you've thought of this already.

What you can do is not have checkboxes, but apply an image to each treenode, one of those images would be a square with a cross in it, the other just a square, and the other nothing.. Then, when you click an item, toggle it's checked property and change to the relevant image.
0
 
LVL 20

Author Comment

by:TheAvenger
ID: 12248935
Hmm, does not seem like the perfect solution. Still 10x for the suggestion.

Have you come accross any custom TreeView control, that is reacher than the one from MS?
0
 
LVL 8

Assisted Solution

by:Razzie_
Razzie_ earned 125 total points
ID: 12253802
TheAvenger,

Might want to take a look at http://www.codeproject.com/cs/miscctrl/treelistview.asp?df=100&forumid=13572&exp=0&select=756432

It is a custom TreeView control, from which I know it for example supports custom checkboxes, and I believe you can disable checking a checkbox... so I hope it comes close to what you want.

HTH,

Razzie
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 8

Expert Comment

by:Razzie_
ID: 12253808
And maybe it will help with your other question too :)
0
 
LVL 18

Accepted Solution

by:
armoghan earned 125 total points
ID: 12256344
this might be helpful
http://www.codeproject.com/cs/miscctrl/TreeViewRadioBox.asp

You may be able to add a node which is a treenode
TreeNodepollNode =
     new TreeNode("Survey");
0
 
LVL 20

Author Comment

by:TheAvenger
ID: 12256505
Thank you very much guys!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question