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

Postback RadWindow and refresh ajax panels in parent page. How to???

4 Answers 189 Views
Window
This is a migrated thread and some comments may be shown as answers.
Giulio
Top achievements
Rank 1
Giulio asked on 15 Aug 2009, 08:53 AM
Hi all, I've red many thread about similar problems but I'm still quite confused...

I have a page with 2 ajax panels in a master-detail classic configuration. In the left one I have a RagGrid with the list of my users. When I click on a row, in the other ajax panel (on the right) I show the detail information of the clicked RadGrid row.

Now, I have 2 buttons in this page:
  1. a button that opens a "Add new user" RadWindow to add a new user
  2. another button inside the detail ajax panel and opens another RadWindow to add/modify detail information about the specific clicked row

What I need is:
  1. when I click on the first button to insert a new user I would, on finish, close RadWindow and refresh both ajax panel in parent page to show the added user in the RadGrid
  2. when I click on the second button to add/modify detail information about a clicked row, on finish, I would refresh only the right side ajax panel with the detail informations of clicked row

How can I managed this scenarious?
Which are the fondametal elements I need in both parent page and RadWindow page to get it works fine?

Thanks very much!

Giulio Ferri

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 17 Aug 2009, 06:29 AM
Hi Giulio,

I would suggest to examine the following demo:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window
And the documentation article about RadAjaxPanel:
http://www.telerik.com/help/aspnet-ajax/ajxajaxpanel.html

In the demo you could see how to call a JavaScript function on the parent page from within the content page in RadWindow. The documentation article shows how to use RadAjaxpanel and its ajaxRequest() client side function in order to update the content of the panel.

I hope this helps.

Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Hunter
Top achievements
Rank 1
answered on 20 Jun 2012, 07:29 PM
I needed the same functionality. I modified my pages based on the demo and it worked.

However, the demo passes the EmployeeID in the query string. I was hoping to set a session variable instead, to avoid issues with users typing in EmployeeIDs that they're not supposed to see. I'd also like to check the session to make sure the user is still logged in, and if not, to redirect to the login page instead of opening the edit form.

Originally my edit column was a GridButtonColumn that opened the edit form through RadGrid1_ItemCommand. Since it was on the server side, I had no problem accessing session variables.

When I started adding the ajax functionality, my edit column broke - it wasn't opening the edit form anymore. I changed the edit column to a GridTemplateColumn with a HyperLink as per the demo, and it worked. But now, can I modify the ShowEditForm() JavaScript function to assign the id to a session variable, and to check another session variable to see if the user is still logged in?
0
Marin Bratanov
Telerik team
answered on 22 Jun 2012, 12:40 PM
Hello,

The Session object is available only on the server and you cannot access it on the client (i.e. via JavaScript). If you need the server functionality I can suggest that you keep the grid command handler and open the RadWIndow via JavaScript (after raising your Session flags) with the approach shown in this sticky thread. An alternative I can suggest is to pass a JavaScript object to the RadWindow as is shown in this help article and this demo. You can get the needed data to build the object via the Grid's client-side rows objects as is shown in this demo by using the client row selection (or you can pass the item index as a parameter to the client-side handler as this demo shows). 


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Hunter
Top achievements
Rank 1
answered on 22 Jun 2012, 05:48 PM
Thanks, Marin. I used the first option and it worked.
Tags
Window
Asked by
Giulio
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Hunter
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or