This is a migrated thread and some comments may be shown as answers.

Tri-state ClientEntryAdding/Removing

2 Answers 47 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 26 Feb 2013, 10:10 PM
Hello,

I have been working to add the new DropDownTree control to my project and noticed an undesired behavior when using it in Tri-state mode.  While checking the boxes visually does display correctly, it doesn't appear that the correct values are getting passed through the OnClientEntryAdding and OnClientEntryRemoving events using this method which you have on your help pages (which I actual found under RadAutoCompleteBox because the help for RadDropDownTree is useless and incomplete):

<script type="text/javascript">
    function entryAdding(sender, eventArgs) {
        alert(eventArgs.get_entry().get_value());
    }
    function entryRemoving(sender, eventArgs) {
        alert(eventArgs.get_entry().get_value());
    }
</script>


For example, using hierarchical tree such as:

[ ] Arizona
 -- [ ] Phoenix
 -- [ ] Tuscon
 -- [ ] Flagstaff
[ ] California
 -- [ ] San Diego
 -- [ ] San Francisco
 -- [ ] Hollywood

...If I check "Arizona", on the UI "Phoenix, Tuscon, and Flagstaff" all get checked as expected, however; "Arizona" appears to be the only value actually returned from the entryAdding alert whereas I would expect to see "Arizona, Phoenix, Tuscon, and Flagstaff" .  Additionally, if I decide to uncheck say Tuscon, the UI does display this correctly and "Arizona" renders as the third state check, however; once again only "Arizona" is returned from the entryAdding alert whereas I would expect to see "Arizona, Phoenix, and Flagstaff".

What am I missing here to get this to return the correct values to mimic what is shown on the UI side?

Regards,
Steve

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter Filipov
Telerik team
answered on 27 Feb 2013, 01:06 PM
Hi Steve,

The EntryAdding and EntryRemoving events are fired only for the checked/unchecked nodes, because they are cancelable . For the entries that are added/removed as a result of node checking/unchecking only EntryAdded and EntryRemoved events are fired.

All the best,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Steve
Top achievements
Rank 1
answered on 27 Feb 2013, 06:51 PM
Excellent, thank you for the assistance.
Tags
DropDownTree
Asked by
Steve
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Steve
Top achievements
Rank 1
Share this question
or