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

RadWindow x Grid

1 Answer 30 Views
Window
This is a migrated thread and some comments may be shown as answers.
Silderado
Top achievements
Rank 1
Silderado asked on 16 Oct 2008, 03:11 PM

 Hi, I'm using the example below to update some information on the screen, after the close radwindow, however with the code: GetRadWindow (). BrowserWindow.location.reload (); the whole screen is being updated, and that I needed to update only the GRID I have.

Still, I'm passing the values manually to the grid.

Can you help me?

 

  1. function RefreshParentPage()
    {
        GetRadWindow().BrowserWindow.location.reload();
    }
    </script>
  2. private void Button2_Click(object sender, System.EventArgs e)
    {
        InjectScript.Text="<script>RefreshParentPage()</" + "script>";
    }

1 Answer, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 20 Oct 2008, 08:23 AM
Hi Silderado,

I suggest to use a RadAjaxManager to update the grid in its OnAjaxRequest event as shown in this online demo. Instead of calling the GetRadWindow().BrowserWindow.location.reload(); method you should call the following method which is declared on the main page:

function refreshGrid(arg)  
            {  
             if(!arg)  
             {  
             $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");               
                }  
                else 
                {  
             $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");               
                }  
            }  
 

and handle the ajax request on the server:

 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
            if (e.Argument == "Rebind")  
            {  
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1.Rebind();  
            }  
            else if (e.Argument == "RebindAndNavigate")  
            {  
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;  
                RadGrid1.Rebind();  
            }  
        }  
 

You can find the full source of the demos on your local disk from here:

Start\Programs\Telerik\RadControls for ASPNET AJAX\Open Sample WebSite In VisualStudio

The actual location on your hard disk is the following one:

C:\Program Files\Telerik\RadControls for ASPNET AJAX\Live Demos

Greetings,

Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Silderado
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or