Hi there. I think this is not telerik-specific but perhaps you might be able to help nontheless:
I have a radWindow with multiple Elements. One of them is a button, another is a "simple" radgrid
One of them is a Button that opens a new window. In that window an element can be changed in the database which is the datasource of the radgrid.
After closing that window I initiate a postback through the "OnClientClose"-Method.
Before opening that window the datasource of the radgrid had 5 Elements. After closing that window the datasource has 6 Elements (as wanted). I can see in the OnNeedsDataSource-Event that the datasource REALLY has that 6 elements. But in the frontend the new element is not shown.
I can close and reopen the window or reload it with response.redirect(response.url.toString()) but that of course kills all form entries made.
Any clue what causes that behaviour?
Ole
P.S:
Perhaps it might help to know that the NeedsDataSource-Event does not fire automaticly after closing the popup. I have to rebind manually for it to fire.
I have a radWindow with multiple Elements. One of them is a button, another is a "simple" radgrid
One of them is a Button that opens a new window. In that window an element can be changed in the database which is the datasource of the radgrid.
After closing that window I initiate a postback through the "OnClientClose"-Method.
Before opening that window the datasource of the radgrid had 5 Elements. After closing that window the datasource has 6 Elements (as wanted). I can see in the OnNeedsDataSource-Event that the datasource REALLY has that 6 elements. But in the frontend the new element is not shown.
I can close and reopen the window or reload it with response.redirect(response.url.toString()) but that of course kills all form entries made.
Any clue what causes that behaviour?
Ole
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DetailInfos.aspx.cs" Inherits="waPMHI.dlg.DetailInfos" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlockInfo"
runat
=
"server"
>
<
script
type
=
"text/javascript"
language
=
"javascript"
>
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseWindow() {
var oWindow = GetRadWindow();
oWindow.close();
}
function AddAttachment() {
var oBrowserWnd = GetRadWindow().BrowserWindow;
setTimeout(function() {
var oWnd = oBrowserWnd.radopen("../dlg/GeneralUploader.aspx", "Upload");
oWnd.SetUrl(oWnd.GetUrl());
oWnd.add_close(OnClientClose);
}, 300);
}
function OnClientClose(oWnd) {
// Nach dem Schliessen eines Fensters: AjaxRequest
oWnd.remove_close(OnClientClose);
$find("<%= infoManager.ClientID %>").ajaxRequest("AddAttachmentClose");
}
<!-- [...] more JS -->
</
script
>
</
telerik:RadCodeBlock
>
</
head
>
<
body
class
=
"dlgInfos"
onkeypress
=
"Escape(event);"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadWindow
ID
=
"DetailInfo"
runat
=
"server"
SkinID
=
"SingletonSkin"
/>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadFormDecorator
ID
=
"RadFormDecorator"
runat
=
"server"
DecoratedControls
=
"Buttons"
/>
<
telerik:RadAjaxManager
ID
=
"infoManager"
runat
=
"server"
OnAjaxRequest
=
"InfoManager_AjaxRequest"
/>
<
table
width
=
"100%"
cellpadding
=
"0px"
cellspacing
=
"0px"
>
<
tr
>
<
td
>
<
asp:UpdatePanel
ID
=
"FormPanel"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<!-- More Elements [...] -->
<
asp:Button
ID
=
"btnAddAttachment"
Enabled
=
"false"
runat
=
"server"
Text="<%$Resources:TextResources, ID_MAIL_ADDATTACHMENT%>"
OnClick="btnAddAttachment_Click" />
<!-- More elements [...] -->
</
ContentTemplate
>
</
asp:UpdatePanel
>
<
br
/>
<
telerik:RadGrid
runat
=
"server"
Width
=
"100%"
ID
=
"attGrid"
ShowHeader
=
"false"
AutoGenerateColumns
=
"true"
OnNeedDataSource
=
"infoGrid_NeedDataSource"
>
</
telerik:RadGrid
>
</
form
>
</
body
>
</
html
>
P.S:
Perhaps it might help to know that the NeedsDataSource-Event does not fire automaticly after closing the popup. I have to rebind manually for it to fire.