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

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

3 Answers 50 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 06 May 2016, 05:55 PM
<%@ 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.

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 11 May 2016, 11:35 AM
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.
0
Missing User
answered on 16 May 2016, 05:23 PM

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.

0
Eyup
Telerik team
answered on 19 May 2016, 04:24 PM
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.
Tags
Ajax
Asked by
Missing User
Answers by
Eyup
Telerik team
Missing User
Share this question
or