• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2891
  • 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

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