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

RadWindow - How do I close it?

2 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 04 Jul 2011, 04:52 AM
Hi

I have a page called LocationSearch.aspx that has RadGrid that lists Locations. 

If you have one selected and you click an Edit button at the top of the page a RadWindow appears.

In it, a separate page called AddEditLocations.aspx that gives you a form populated with the selected locations details.

My RadWindow declaration looks like this.

<telerik:RadWindow ID="rwAddLocation" NavigateUrl="AddEditLocation.aspx" Title="Add/Edit Location" Modal="true" runat="server" Width="700" Height="600" /> 
            

The Edit button has an OnClick event that calls this javascript on the LocationSearch page.

function showAddLocationForm(){
    var win = $find("<%#rwAddLocation.ClientID %>");
    win.show();
    win.center();
}

This works a treat.

However, now that I am in the RadWindow's AddEditLocation page, I need to do 3 things.

1. I need to have an OnClick event that posts back so I can write to the DB.

2. Next, I need the RadWindow to Close

3. I need to LocationSearch page to refresh it's RadGrid to reflect data that may have changed during the edit.

Point 1 I have sussed. However I can't work out how this RadWindow can close itself or how it can get the parent page to refresh.

The reason we put the edit form in a separate page is that we need to reuse it elsewhere on the site. It remains an option that I may have to put the AddEditLocation.aspx form in the RadWindow on the LocationSearch page. We would rather not do that but if I had to be that way let me know please.

Any tips would be appreciated.

Brad

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 04 Jul 2011, 12:28 PM
Hello Brad,

I believe that the Grid Editing demo will be of help - check the EditFormCS(VB) page and its codebehind to see how to post to the server and then output JavaScript that would call a function in the parent page (which will update the grid via Ajax) and then will close the RadWindow.


Best wishes,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Brad
Top achievements
Rank 1
answered on 05 Jul 2011, 01:06 AM
Thanks Georgi

That looks like it will do exactly what I need.

Tags
General Discussions
Asked by
Brad
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Brad
Top achievements
Rank 1
Share this question
or