Rank: Newbie Groups: Member
Joined: 6/23/2008 Posts: 1
|
Our company just bought a license for the treeview control. Now we have discovered a "small big problem". We have to have the ability to disable just the checkbox of a parent in the treeview. As it is now, as we understand it, its just possible to disable the whole node which leads to that you cant expand the node to see whats further down the tree. Is there any way to do this?
In an answer by mail from the EO-team they said...
"You can show/hide the checkbox on each TreeNode by setting the TreeNode's ShowCheckBox property. For example, if you set the parent node's ShowCheckBox to false, then set all the child node's ShowCheckBox to true, you will get checkbox only on the child node, but not on the parent node."
The thing is we need a checkbox on the parent node. It just have to be disabled. Visible but not clickable. And you have to be able to expand the tree.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Unfortunately there is no way to directly disable a checkbox on the TreeNode. There are two indirect ways that come close:
1. Set ShowCheckBox to false, then include standard HTML such as <input type="checkbox" /> in the TreeNode's Text property. This way you will have full control of the checkbox, but the TreeView won't do anything with the checkbox; 2. Set ShowCheckBox to true, then handle the TreeView's ClientSideOnCheckStateChanging event. Return false from this event to prevent the checkbox from being selected. Note the checkbox will still appear enabled, but can not be checked;
Thanks
|