Solved

C# TreeView that shows CheckBoxes ONLY in chosen Nodes

Posted on 2004-09-09
11
2,847 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
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.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
detecting  the added row index in a datagridview 3 70
Need help on C# Linq query on object 6 62
Graphics 2 27
C# bracket error 3 30
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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

12 Experts available now in Live!

Get 1:1 Help Now