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

RadWindow - refreshing the grid within?

1 Answer 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 28 Sep 2011, 05:42 AM

I have a page that has a radgrid and several children grids in tabs under that main grid.  Click a row on the master grid and all the child grids update. This is not the problem

Next I have and EDIT button at the top of the page. Clicking this spawns a RadWindow the contents of which is a seperate page which itself has 4 tabs. 1 of which contains a RadGrid.

So far my structure (in a psudocode kind of way) looks like this

LocationPage
      RadWindow(EditLocationPage.aspx)
            Tab1()
            Tab2()
            Tab3()
            Tab4(AddressesRadGrid)


When data was changed on this page I ran this javascript to refresh the parent page grids. This too worked perfectly.

function CloseAndRebind(args) {
        GetRadWindow().Close();
        GetRadWindow().BrowserWindow.refreshGrid(args);
 
    }

Now to the issue.

As I mentioned there is a grid on the popup page in the 4th tab. The way this page is set up is that you select a row, and then click a common Edit button to edit that row. Clicking the Edit button opens yet another RadWindow with a form for adding/editing Addresses.

Now my phsuocode model of my windows and such looks like this.

LocationPage
      RadWindow(EditLocationPage)
            Tab1()
            Tab2()
            Tab3()
            Tab4(AddressesRadGrid)
                     RadWindow(EditAddress.aspx)


I'll cut to the chase, When I click the save button on the Edit Address page, the javascript above does not refresh the Address grid on the EditLocation page. It does however do what it always did. That is, refresh the grids on the parent page (LocationPage).

Seems that this line

GetRadWindow().BrowserWindow.refreshGrid(args);

...is the one I need to change.

Just, what do I change it too? How to a get a grid in a rad window to refresh?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 30 Sep 2011, 11:29 AM
Hi Brad,

I assume that the RadWindow containing the EditAddress.aspx page is opened from the LocationPage. In that case its BrowserWindow property will point to that page and not to the EditLocationPage.aspx.

There are two ways to resolve this
1) declare the EditAddress RadWIndow in the EditLocationPage.aspx. This way its BrowserWindow property will point to the window object of the EditLocationPage.aspx and you can put a refreshGrid() function there as well. This has the limitation that the   EditAddress RadWIndow  will be confined in the EditLocationPage RadWindow. But the calling of the functions is easier

2) Once you get the reference to the topmost page you can get a reference to the EditLocationPage RadWiundow and call a function declared in it (i.e. you will again need to put a refreshGrid() function in the EditLocationPage.aspx page). The way to get a reference to a specific RadWindow and call a function declared in its content page is described in this help article. This approach is a little harder to implement, but will have the EditAddress RadWIndow  free in the browser.

If your next question is how to ajaxify the grid in the   EditLocationPage  RadWIndow I advise that you examine this help article first. In short - like you would in a standalone page, not loaded in a RadWindow.


All the best,
Marin
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
Tags
General Discussions
Asked by
Brad
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or