One Server Event on DropDown close

2 posts, 0 answers
  1. Gosha
    Gosha avatar
    36 posts
    Member since:
    Aug 2010

    Posted 24 Nov 2013 Link to this post

    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. 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Nov 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top