Solved

Single node in a TreeView without a checkbox

Posted on 2004-10-07
6
681 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updating a single record in forEach using C#/Entity 7 35
ASP.NET data base connection 35 81
Stop Git from being my repository 1 44
async questions 5 46
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…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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 …

736 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