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

Can I do that ??

3 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Smiely
Top achievements
Rank 1
Smiely asked on 30 Jun 2011, 09:51 PM
I have RadWindow poping up from RadGrid column click. I am always reloading the grid when RadWindow is closed to reflect the changes. If nothing has changed, I am wasting time and resources for reloading grid. How can I check if something has done in RadWindow? can I do that ?

Please help.... need experts guidence on this ...
Smiely

3 Answers, 1 is accepted

Sort by
0
Genti
Telerik team
answered on 01 Jul 2011, 03:44 PM
Hello Smiely,

Thank you for contacting us.

In this case you can make use of the RadScriptManager response scripts or if you are using some rad ajax panel or ajax manager you can use their ResponseScripts function.
Say, in case you have updated the data source then you inject a script that tells the RadWindow to call the function and rebinds the grid, otherwise call just the function that closes the window.

Another solution would be to pass an argument through the script manager, then that argument will be available in the method that initiates the ajax request and decide whether the ajax request should be fired or not.

Hope this helps.

Kind regards,
Genti
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
Smiely
Top achievements
Rank 1
answered on 01 Jul 2011, 08:46 PM
Thanks so much fro answering my question. Can you get me some example of it?

Smiely
0
Genti
Telerik team
answered on 04 Jul 2011, 10:18 AM
Hi Smiely,

You can do the following:
In the window page make sure you have implemented:
function CloseWindowAndRebind(needToRebind) {
    GetRadWindow().BrowserWindow.refreshGrid(needToRebind);
    GetRadWindow().close(needToRebind);
}
    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow)
            oWindow = window.radWindow;
        else if (window.frameElement.radWindow)
            oWindow = window.frameElement.radWindow;
        return oWindow;
    }

Then in the code behind you would have:
string functionName= string.Format("CloseWindowAndRebind({0})", "yes");
ClientScript.RegisterStartupScript(Page.GetType(), "someId", functionName, true);

And on the other page (that has the grid):
function refreshWindow(needToRefresh) {
    if(needToRefresh=="yes")
        //do something
}


Hope this helps.

Regards,
Genti
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.

Tags
Grid
Asked by
Smiely
Top achievements
Rank 1
Answers by
Genti
Telerik team
Smiely
Top achievements
Rank 1
Share this question
or