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

Update a listbox when Radwidow closes

2 Answers 54 Views
Window
This is a migrated thread and some comments may be shown as answers.
Eric Klein
Top achievements
Rank 1
Eric Klein asked on 12 Mar 2010, 11:04 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Mar 2010, 07:09 AM

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.

0
Eric Klein
Top achievements
Rank 1
answered on 15 Mar 2010, 03:45 PM
I have tried this but the Update panel and the RadAjax Manager clash.  I get this when it runs the on client close.

Tags
Window
Asked by
Eric Klein
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Eric Klein
Top achievements
Rank 1
Share this question
or