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

Updates not shown

2 Answers 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ole Albers
Top achievements
Rank 2
Ole Albers asked on 08 Dec 2010, 11:47 AM
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
<%@ 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">
<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.

2 Answers, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 08 Dec 2010, 03:03 PM
Hi Ole,

Try adding a setting to the RadAjaxManager where the RadAjaxManager updates the grid and see if it makes any difference:

<telerik:RadAjaxManager ID="infoManager" runat="server" OnAjaxRequest="InfoManager_AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="infoManager">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="attGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>


Greetings,
Iana
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Ole Albers
Top achievements
Rank 2
answered on 08 Dec 2010, 04:30 PM
That DID help. Thanks
Tags
General Discussions
Asked by
Ole Albers
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Ole Albers
Top achievements
Rank 2
Share this question
or