Hello. I have a modal popup RadWindow being used as an edit form. This RadWindow is launched from a row in a RadGrid. Everything works great, except when the user finishes with the RadWindow and it closes, the calling RadGrid successfully does a rebind, but it doesn't visually update on the screen. The auto-refreshing the RadGrid works great for other uses such as deleting a record, or updating a record, but not when the rebind code runs upon returning from the modal RadWindow. When the radwindow closes, it triggers the RadAjaxManager1_AjaxRequest which does the rebind operation. That runs just fine. The only thing not happening is the rendering of the screen so the user sees the updated data in the radgrid.
Anyone have any ideas why this would be happening or way to force the re-rendering of the screen/radgrid?
This is the script on the source page:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function refreshGrid(arg) {
if (!arg) {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
else {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
</script>
</telerik:RadCodeBlock>
This gets calls when the popup closes:
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest If e.Argument = "Rebind" Then rgVehicleConfig.DataSource = Nothing rgVehicleConfig.Rebind() End If End Sub
This is the script on the popup aspx page:
<script type="text/javascript">
function CloseAndRebind(args)
{
GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
document.getElementById("frmSequencingAreas").submit();
}
function Close(args)
{
GetRadWindow().close();
}
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
</script>
Finally, this is the code for the final import of the data that closes the RadWindow and returns to the calling page:
Private Sub rgVehicleConfiguration_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles rgVehicleConfiguration.ItemCommand
If e.CommandName = "Export" Then
If ErrorsFound Then
lblMessage.Text = "Highlighted values are invalid. Please correct and try importing file again.</br>Data cannot be imported until all errors are corrected."
Else
ExportData()
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", True)
ShowPopup = False
End If
End If
End Sub
Most of this code was lifted from Telerik's own demo and that seems to work just fine here on the Telerik demo site.
Any help would be wonderful.
Thank you.