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

Rebind Radgrid does not refresh when radwindow closes

5 Answers 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 11 Jan 2013, 04:28 PM

I am trying to rebind my grid once a radwindow has been closed through master page. My grid is in a usercontrol in aspx page. In master page i have :

 function CancelEdit() {
            GetRadWindow().Close();
        }

        function CloseAndRebind() {
            GetRadWindow().BrowserWindow.refreshGrid(); // Call the function in parent page 
            GetRadWindow().close(); // Close the window 
        }

        function refreshGrid() {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }

and I have the following javascript in the user conrtrol:

<script type="text/javascript" language="javascript">
    function refreshGrid() {
        $find("<%= RadAjaxManager.GetCurrent(me.Page).ClientID %>").ajaxRequest("Rebind");
    }

</script>

Once I close update the database in radwindow i register a javascript:

 ScriptManager.RegisterStartupScript(Page, Page.GetType(), "mykey", "CloseAndRebind();", True)

I can see my data source changing but the grid doesn't get updated. any suggestions?

5 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 11 Jan 2013, 04:49 PM
Hello,

Please try with below code snippet.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>


Thanks,
Jayesh Goyani
0
Sam
Top achievements
Rank 1
answered on 14 Jan 2013, 09:44 AM
I already have a radajaxmanager in masterpage...Do i need to add this inside my user control?

This is detailed structure of my site:

I have master page which has the RadAjaxManager.
There is a main page which has a user control
Another user control inside above user control which has the RadGrid
Then there is an aspx page that opens as radwindow
0
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Jan 2013, 05:21 AM
Hello,

Please use "RadAjaxManagerProxy" inplace of "RadAjaxManager".

Thanks,
Jayesh Goyani
0
Sam
Top achievements
Rank 1
answered on 16 Jan 2013, 12:38 PM
thanks for reply...

Which control or page should I use it on? 
0
Shinu
Top achievements
Rank 2
answered on 29 Jan 2013, 06:59 AM
Hi,

Add the RadAjaxManagerProxy in the UserControl and in the Content Page. RadAjax no longer allows more than one RadAjaxManager on the page. Instead, in a complex scenario like WebUserControls or Master/ContentPages, one should place RadAjaxManager instance on the main/master page and add a proxy control to the user control/content page. Please check this help documentation for more details.

Thanks,
Shinu.
Tags
Grid
Asked by
Sam
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Sam
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or