Mar 02, 2008, 1:05 AM
GridView style affected by scriptmanager?
Here's my test: (VB ASP.NET project)
Default.aspx:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestWebSite.HomePage" %>
<%@ Register Assembly="Coolite.Web.UI" Namespace="Coolite.Web.UI" TagPrefix="cool" %>
<!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>Hello World!</title>
</head>
<body>
<cool:ScriptManager ID="ScriptManager1" runat="server" Hide="True" />
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="true" Width="300px" style="text-align: center;">
</asp:GridView>
</form>
</body>
</html>
Default.aspx.vb:Imports System.Data
Partial Public Class HomePage
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dt As New DataTable
dt.Columns.Add("A", GetType(Integer))
dt.Columns.Add("B", GetType(String))
Dim dr As DataRow = dt.NewRow
dr("A") = 1
dr("B") = "test"
dt.Rows.Add(dr)
GridView1.DataSource = dt
GridView1.DataBind()
End Sub
End Class
If you take away the scriptmanager in the .aspx file vs if you leave it in, there's a major style difference (especially the header can't be centered no matter what I try...).Thanks for the help in advance.