Solved

Single node in a TreeView without a checkbox

Posted on 2004-10-07
6
674 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now