Update a listbox when Radwidow closes

3 posts, 0 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 12 Mar 2010 Link to this post

    I am trying to update a list box on the parent when a radwindow closes.  The listbox is populated from a database in code behind.  Actuallly happens on a dropdown_selected index change event.  Just want to load the listobx with the new data when the user closes the radwindow.

    One more think I have an update panel and when I tried to ues a RadAjaxManager they clashed.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Mar 2010 Link to this post

    Hello Eric,

    One approach would be attaching OnClientClose event to window, and in the event handler invoke an ajaxRequest(). Then from the server side RadAjaxManager1_AjaxRequest event, refresh the RadListBox.

    JavaScript:

     
    <script type="text/javascript">    
    function OnClientClose()    
    {    
         $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();    
    }    
    </script>   

    C#:

     
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)    
    {  
        // Set the DataSource and DataBind() RadListBox    
    }   

    Also set the AjaxSetting as shown below.

    ASPX:

     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">    
        <AjaxSettings>    
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">    
                <UpdatedControls>    
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1" />    
                </UpdatedControls>    
            </telerik:AjaxSetting>    
        </AjaxSettings>    
    </telerik:RadAjaxManager>   

    Hope this helps,

    Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 15 Mar 2010 Link to this post

    I have tried this but the Update panel and the RadAjax Manager clash.  I get this when it runs the on client close.

Back to Top