Solved

C# TreeView that shows CheckBoxes ONLY in chosen Nodes

Posted on 2004-09-09
11
2,853 Views
Last Modified: 2008-02-01
Hello,

Could you please help me to create a TreeView (C#). The TreeView must have CheckBoxes only in some Nodes (parent or children does not matter) chosen at run-time. I do not want my TreeView to have a CheckBoxes in any Node, as it is in .Net Framework now.

Thank you.
0
Comment
Question by:AJBykov
  • 4
  • 4
11 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12020524
there is a property of the node which says whether or not there is a checkbox.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12020526
i am not quite sure what else you are asking for.
0
 

Author Comment

by:AJBykov
ID: 12021562
Every TreeNode has Checked property. When I set TreeView -> CheckBoxes property every Node in TreeView gets a CheckBox. I do not need a CheckBox near every Node. I would like to decide in run-time which node has a CheckBox and which does not. Looks like I have to create my own TreeView...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 12021629
you would need to override the painting of the treeview (not trivial) or deal directly with the API ...

if you want to do this I can give you some examples ...
0
 

Author Comment

by:AJBykov
ID: 12022208
Yes, please. I will override the painting of the TreeView. If you could provide me a sample I would greatly appreciate that.
0
 

Expert Comment

by:shilpa2784
ID: 12024074
Do you want to get the checkbox for a specific node at the runtime?? If yes i dont think it is possible with the existing treeview control ....u have to override and create your own treeview control
0
 

Author Comment

by:AJBykov
ID: 12026596
Yes, I am doing that right now. Could you tell me that the button "Accept" (near a comment) means?
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12027265
it means to accept that comment as your answer ... I started working on this last night but its not only a few lines of code, I will try to get back to it this evening.
0
 

Author Comment

by:AJBykov
ID: 12027319
Thank you!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 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