Welcome Guest Search | Active Topics | Sign In | Register

Treeview with checkbox Options
Gustavo
Posted: Monday, May 19, 2008 12:20:17 PM
Rank: Newbie
Groups: Member

Joined: 10/1/2007
Posts: 1
I'm using the EO.Web.TreeView and the nodes I'm setting the showcheckbox=true and the AutoCheckChildren=true , AutoCheckParent=true and AutoUncheckChildren=true properties.

The controls renders the nodes and child nodes correctly, but if I have a third level or more, and I set the children node checked=true, just the your parent get its property, and the root node doesn't get this.

If the Checked property of a node is checked true (by code), the parent and its childs (when occurs) the nodes aren't checked automatically.

Is it a problem or a product caracteristc?
eo_support
Posted: Tuesday, May 20, 2008 9:14:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

Thanks for posting in the forum. I believe that behavior is by design. AutoCheckChildren, AutoCheckParent and AutoUncheckChildren only applies when a user click the node to check/uncheck it. It does not apply when you check/uncheck a node by code.

The reason that is implemented this way is to allow user to have full control over which node can be checked/unchecked when they do it through code. The idea is, if you choose to do it through code, most of the time you do not want to have limitations. If we were to automatically apply those AutoXXX properties there, then some users who want to use those properties, but want to have some special checking patterns on certain nodes (for example, for most items automatically checks parent item, but for one item he doesn't want to) would find out their design is simply not possible. On the other hand, pretty much everything is possible with the current design.

Another reason that these properties are ignored when setting Checked through code is that the sequence of checking/uncheck matters a lot. For example, with all those property set, when user check the parent node manually and then click a child node, the result is all nodes are checked, except for the single child node that was last clicked. However the result would be totally different if user were to click the child node first and then click the parent node. Such difference is very easy to understand when user does it manually because he/she can have immediately visual feedback from the TreeView. However if the same logics are applied when setting through code, many programmers can easily get confused within a few steps. So we decided to keep it simple: You get what you set, nothing more and nothing less.

The drawback of the current design is that, you may need to write a little bit more code to check the check state of a few more items (parent item, child items, etc) in order to decide whether to proceed with your specific business logic. But those code should be fairly easy.

Please feel free to let us know if you have any problems or questions.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.