Hi Renato,
Thank you for the provided project, but I deleted the link because the project contained a dev version of Telerik.Web.UI.dll and was available in the forum. Please, in the future in case you want to provide a project with a dev dll, open a new support ticket and attach it there.
I examined the project but I did not find the code which updates the grid there. I suggest to use the RadAjaxManager control in order to achieve the desired functionality, as shown in
this online demo which shows the desired scenario.
The RadAjaxManager should have the following setting:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
|
The function, which refreshes the grid is the following:
function refreshGrid(arg) |
{ |
if(!arg) |
{ |
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); |
} |
else |
{ |
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate"); |
} |
} |
|
and it is called from within the RadWindow (by referencing its parent page).
The server handler for the ajax request is this one:
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 also have the full source code of the demo on your local disk because when you install RadControls, our online examples projects are automatically installed on your computer.
You can open the demos 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 Q1 2008\Live Demos
In case you still experience problems, please open a new support ticket and attach your project there along with a sample database and the needed connections to it.
Regards,
Svetlina
the Telerik team