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

One Server Event on DropDown close

1 Answer 84 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Gosha
Top achievements
Rank 1
Gosha asked on 25 Nov 2013, 12:19 AM
I am using RadDropDownTree with checkboxes and server events OnEntryAdded and OnEntryRemoved.
Problem is with that events that they fires for every checked node instead just once. When user checks 10 nodes and closes drop down, event fires 10 times! Because it is server event and trigers grid refresh (and pull data from database), this is a big problem. I could not find other event for drop down close, really, a dont want to collect one by one node, its just fine to fire one event and use SelectedValue property. 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Nov 2013, 11:04 AM
Hi Gosha,

Please have a look into the following code snippet to achieve your scenario.

ASPX;
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
</telerik:RadAjaxManager>
<telerik:RadDropDownTree ID="RadDropDownTree1" runat="server" CheckBoxes="SingleCheck"
    AutoPostBack="true" DataFieldID="id" DataFieldParentID="parentid" DataSourceID="SqlDataSource1"
    DataTextField="text" OnClientDropDownClosed="OnClientDropDownClosed" DataValueField="text">
</telerik:RadDropDownTree>

JavaScript:
<script type="text/javascript">
    function OnClientDropDownClosed(sender, args) {
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
        ajaxManager.ajaxRequest();
    }
</script>

C#:
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
    GetSelecteValue();
}
public void GetSelecteValue()
{
    string text = RadDropDownTree1.SelectedValue;
}

Hope this will helps you.
Thanks,
Shinu.
Tags
DropDownTree
Asked by
Gosha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or