Hi all,
If I have a RadGrid hidden on the page (either through setting it's property or doing it dynamically at runtime in Page_Load), and then later make it visible, it looses all it's Skin information. Here's a quick sample page I created to demonstrate the problem.. I tried also using the RadScriptManager and got the same effect.
Thanks!!
ASP.NET
C# CODEBEHIND
If I have a RadGrid hidden on the page (either through setting it's property or doing it dynamically at runtime in Page_Load), and then later make it visible, it looses all it's Skin information. Here's a quick sample page I created to demonstrate the problem.. I tried also using the RadScriptManager and got the same effect.
Thanks!!
ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HiddenRadGridTest.aspx.cs" Inherits="HiddenRadGridTest" %> |
<%@ 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"> |
<title>Untitled Page</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<div> |
<br /> |
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> |
<ContentTemplate> |
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> |
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="dsTest" GridLines="None" |
Visible="False"> |
<ExportSettings> |
<Pdf FontType="Subset" PaperSize="Letter" /> |
<Excel Format="Html" /> |
</ExportSettings> |
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="None" CurrentResetPageIndexAction="SetPageIndexToFirst" |
DataKeyNames="CustomerID" DataSourceID="dsTest" Dir="LTR" Frame="Border" TableLayout="Auto"> |
<EditFormSettings> |
<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"> |
</EditColumn> |
</EditFormSettings> |
<Columns> |
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="CustomerID" |
FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="CustomerID" |
ReadOnly="True" SortExpression="CustomerID" UniqueName="CustomerID"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="CustomerName" |
FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="CustomerName" |
SortExpression="CustomerName" UniqueName="CustomerName"> |
</telerik:GridBoundColumn> |
</Columns> |
<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" |
Resizable="False" Visible="False"> |
<HeaderStyle Width="20px" /> |
</ExpandCollapseColumn> |
<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" |
Visible="False"> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
</MasterTableView> |
</telerik:RadGrid><br /> |
<asp:SqlDataSource ID="dsTest" runat="server" ConnectionString="<%$ ConnectionStrings:XXX_ConnectionString %>" |
SelectCommand="SELECT * FROM [MyTable]"></asp:SqlDataSource> |
</ContentTemplate> |
</asp:UpdatePanel> |
</div> |
</form> |
</body> |
</html> |
C# CODEBEHIND
using System; |
using System.Data; |
using System.Configuration; |
using System.Collections; |
using System.Web; |
using System.Web.Security; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
using System.Web.UI.WebControls.WebParts; |
using System.Web.UI.HtmlControls; |
public partial class HiddenRadGridTest : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void Button1_Click(object sender, EventArgs e) |
{ |
Button1.Visible = false; |
RadGrid1.Visible = true; |
} |
} |