Setting ShowCheckBox on a single node when ShowCheckBoxes for a TreeView is "Leaf"

S

scartin

I'm currently using a TreeView to represent a tree of selections
available to a user. Some may already be populated, and these should
not be editable (i.e. the user can not clear the selection). Since
this functionality seems to be lacking with the basic TreeView
control, and third-party utilities aren't an option at this time, I
opted to simply use the ShowCheckBox method on the TreeNode I wished
to make read-only, and then use the ImageURL attribute to put an image
in place of the checkbox to indicate the read-only status.

However, it seems this is messing about with what the TreeView
considers to be a "leaf" node. If I do this for one single node and
set TreeNode.ShowCheckBox = false, the parent node will now have a
Checkbox next to the text. This occurs whether there are or are not
additional children of that parent that still contain selectable
checkboxes.

I don't understand why this would react that way... these parent nodes
still have children, therefore they are not "leaf" nodes. In almost
all cases, they still have checkboxes as well, so it shouldn't be that
it's making its determination on how many children with checkboxes
exist. Has anyone seen this behavior before, and is there anything I
can do to control it?

Thanks for your assistance,
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top