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

[Solved] Rebind listbox upon Window close

3 Answers 375 Views
Window
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 17 Oct 2007, 05:08 PM
Hi,

I was wondering if you had an example on how to rebind a listbox when a window is closed.  I can do it fine with RAD Grid using samples provided, but can't figure out how that can be applied to asp.net ListBox.

Thanks,

Marek

EDIT: I forgot to mention that I would like to do it as an AJAX-enabled rebind, not just regular postback.

3 Answers, 1 is accepted

Sort by
0
Jason Maronge
Top achievements
Rank 1
answered on 18 Oct 2007, 03:26 AM
Marek,

    Are you trying to reload a listbox on the parent page on window close?  If so then you can do the following:

//This code is used to provide a reference to the radwindow "wrapper"  
function GetRadWindow()  
{  
   var oWindow = null;  
   if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog  
   else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)  
   return oWindow;  
}  
 
 
function CloseOnReload()  
{  
   GetRadWindow().close();  
}  
 
 
function RefreshParentPageListBox()  
{  
   GetRadWindow().BrowserWindow.refreshPageListBox();  

refreshPageListBox() is a method on the parent page and in that method you can do a AjaxRequest to update any part of the page you want to.

Hope this helps...

Jason
0
Steve
Top achievements
Rank 2
answered on 18 Oct 2007, 04:08 AM
Jason,

Thanks for your reply.  The parent page function is what I'm actually having a problem with.  I'm using the same exact method you have described to do a RadGrid rebind when a window is closed, but I simply can't figure out how to do an AJAX update on a non-Telerik control.  So what I'm actually asking for is therefreshPageListBox() function - I have no idea what should go in it. 
Marek
0
Georgi Tunev
Telerik team
answered on 18 Oct 2007, 06:34 AM
Hi Marek,

I've just answered your support ticket on the same subject. For convenience I am pasting my reply below:



Generally speaking you can use the same approach with RadAjax as well. e.g. attach to the RadWindow's OnClientClose function and use the RadAjax Client-Side API to make an Ajax call that will do what you need.




Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Steve
Top achievements
Rank 2
Answers by
Jason Maronge
Top achievements
Rank 1
Steve
Top achievements
Rank 2
Georgi Tunev
Telerik team
Share this question
or