• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2875
  • Last Modified:

C# TreeView that shows CheckBoxes ONLY in chosen Nodes

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
AJBykov
Asked:
AJBykov
  • 4
  • 4
1 Solution
 
gregoryyoungCommented:
there is a property of the node which says whether or not there is a checkbox.
0
 
gregoryyoungCommented:
i am not quite sure what else you are asking for.
0
 
AJBykovAuthor Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gregoryyoungCommented:
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
 
AJBykovAuthor Commented:
Yes, please. I will override the painting of the TreeView. If you could provide me a sample I would greatly appreciate that.
0
 
shilpa2784Commented:
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
 
AJBykovAuthor Commented:
Yes, I am doing that right now. Could you tell me that the button "Accept" (near a comment) means?
0
 
gregoryyoungCommented:
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
 
AJBykovAuthor Commented:
Thank you!
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now