Making a RadGrid an UpdatedControl target in a RadAjaxManager control forces the Visible property to false.

4 posts, 0 answers
  1. ksuh
    ksuh avatar
    44 posts
    Member since:
    Jul 2006

    Posted 06 May Link to this post

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="radAjaxManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="radGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radGrid2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
     
     
        <telerik:RadGrid ID="radGrid1" runat="server"></telerik:RadGrid>
        <telerik:RadGrid ID="radGrid2" runat="server"></telerik:RadGrid>
     
        <telerik:RadCodeBlock runat="server">
        <%= radGrid1.Visible %>
     
        <%= radGrid2.Visible %>
        </telerik:RadCodeBlock>
    </div>
    </form>
    </body>
    </html>

     

    Please fix.  This is really annoying because all controls in the RadGrid will then have a Visible property value of false, even if they are visible.

  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 11 May Link to this post

    Hi,

    This behavior is basically expected due to RadAjaxManager internal logic of placing the controls within update containers. In order to the Visible property to return true, you can place the RadScriptBlock before the RadGrid controls. Alternatively, you can try to remove the RadAjaxManager and wrap the RadGrids with RadAjaxPanel.

    I hope the clarification was helpful.

    Regards,
    Eyup
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ksuh
    ksuh avatar
    44 posts
    Member since:
    Jul 2006

    Posted 16 May in reply to Eyup Link to this post

    The problem with suggestion #1 is that in code-behind, if I'm handling the ItemDataBound event, the grid's visibility is false.

     

    The problem with suggestion #2 is that the RadAjaxPanel is useful in only the most trivial use cases.  I have complex Ajax scenarios that require the use of the RadAjaxManager.

  5. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 19 May Link to this post

    Hello,

    The ItemDataBound logic should be fine though. I've created a sample RadGrid web site to test the described behavior. Please run the attached web site and let me know about the result.

    Regards,
    Eyup
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top