I am using the TreeView with "interactive checkboxes. When I check a child node, the parent node will be also be set or partially set. This is working great!
However, if I check a child node, I am getting the AfterCheck event multiple times. I really only need it once.
The problem is that I need to create a complex query based on the state of the tree. I do not want to do this many times as it only needs to be done once.
ADAdministrator Syncfusion Team March 8, 2004 04:20 PM
I have tested for this issue in our latest release and the AfterCheck event seems to work fine here. It gets fired only once in response to a node being checked (child or parent). Please let me know the version of Essential Suite that you are using. Thanks for your interest in Syncfusion products.
MBMatthew BrohnMarch 9, 2004 06:11 AM
Hmm.. it definitely doesnt work that way here. I am using TreeViewAdv 22.214.171.124. I have a sample I can email you but essential all that is to it is:
1) One Parent node and One Child node
2) Interactive and ShowCheckboxes = true
3) AfterSelect event
-When I select the child I get 3 calls to the AferSelect method
If you want my project let me know how to get it to you otherwise try the above steps and see if you can repro with them..
ADAdministrator Syncfusion Team March 9, 2004 07:25 AM
Thanks for the additional information.I could observe this issue here, and have notified the development team in this regard. I will update you as soon as they get back to me. We appreciate your patience and cooperation.
JFJohn FreeborgMarch 9, 2004 01:54 PM
We are using the 126.96.36.199 beta
Actually the more we investigate, the behavior of the AfterCheck events seems to be what I would expect.
However, our situation is that we want to do something expensive in terms of cpu time, but only after all the AfterCheck events have been dispatched and the tree has "settled" down.
With the tree in interactive mode however, single operations by the user could result in 1 or many AfterCheck events so we don''t really know when the TreeViewAdv control is "done" with them. I guess we could put some lazy timer in, but that seems fragile and non-optimal.
We''ve looked at the other events the TreeViewAdv class dispatches, but nothing seems obvious to us and we''ve tried hooking a few and they didn''t do what we want.
Sort of a "AfterInteractiveChecks" event is what we seem to be looking for.
ADAdministrator Syncfusion Team March 9, 2004 02:11 PM
The reason behind the AfterCheck event being fired thrice is explained below :
The nodes have the InteractiveCheckBox property set which will adjust the parent''s property when the child''s check state is changed, and the child''s CheckState when the parent''s check state is changed.
That accounts for 2 of the 3 events fired. The third event fired is because the root node''s check state is also updated when the top-most node''s check state is changed. However we find this unnecessary and hence have modified the source code accordingly to eliminate the evnt from firing for the third time. We appreciate your feedback, and thanks for choosing Syncfusion products.
JFJohn FreeborgMarch 9, 2004 03:08 PM
I understand your response.
However, it doesn''t seem to address anything in my last post.
Is there some event we can listen for that will fire when the tree view is done firing _all_ the AfterCheck events as a result of some user interaction (either by mouse or keyboard)?
For us the whole tree represents the parameters that we will use to go off and perform a time consuming operation. After the user changes a check state, we need to know when the tree "settles down" so we can walk the state of the whole tree and then go off and do our expensive operation.
At the moment we end up kicking off expensive operations for _every_ AfterCheck and that isn''t what we want. But creating a timer in the AfterCheck handler that when expired says "hmmm...guess that must have been the last AfterCheck event we might be getting because 500 millis went by" or something doesn''t seem like a great solution.
Is this clear? Maybe I''m not describing this well enough.
ADAdministrator Syncfusion Team March 10, 2004 08:25 AM
Our apologies for having not understood your requirements correctly earlier. We have considered your suggestion for a AfterInteractiveChecks event as a feature request, and this has been internally implemented now. This feature will be available in the next release of Essential Suite. We appreciate your feedback, and thanks for choosing Syncfusion products.