Hi John,
I have not been able to reproduce your problem. I dragged a datagrid onto a
form and filled it from the Pubs database. I tried it with a dozen records
and then again with just two. In both cases the row height was the same.
Can you post instructions for reproducing your problem?
Here are the instructions to reproduce my test.
* drag a datagrid onto a web form.
* add the following to the code-behind (and adjust the connection string as
needed). This will select two records from the pubs database.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Bind()
End If
End Sub
Private Sub Bind()
Dim Qry1 As System.Data.SqlClient.SqlDataReader
Dim connectionString As String = "server='localhost';
trusted_connection=true; Database='pubs'"
Dim sqlConnection As System.Data.SqlClient.SqlConnection = New
System.Data.SqlClient.SqlConnection(connectionStri ng)
Dim queryString As String = "SELECT top 2 au_id, au_lname, au_fname FROM
authors"
Dim sqlCommand As System.Data.SqlClient.SqlCommand = New
System.Data.SqlClient.SqlCommand(queryString, sqlConnection)
sqlConnection.Open()
Qry1 =
sqlCommand.ExecuteReader(System.Data.CommandBehavi or.CloseConnection)
DataGrid1.DataSource = Qry1
DataGrid1.DataBind()
Qry1.Close()
sqlCommand.Dispose()
sqlConnection.Close()
sqlConnection.Dispose()
End Sub
Thank you, Mike
Microsoft, ASP.NET Support Professional
Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.
This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
> Content-Class: urn:content-classes:message
> From: "JOhn" <>
> Sender: "JOhn" <>
> Subject: Cell Height
> Date: Tue, 30 Sep 2003 13:56:27 -0700
> Lines: 14
> Message-ID: <0ac401c38795$50b87a90$>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Thread-Index: AcOHlVC4m5hOpfY4SdC3Grg27KkNfA==
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
> Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
> Path: cpmsftngxa06.phx.gbl
> Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.datagridc ontrol:6836
> NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
> X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
>
> Hi,
> I have a datagrid on a form in VS.NET. When the grid has
> 5 or so items in it the cell height looks great. However,
> sometims the grid only has 1 or 2 rows. When this happens
> the cell heights get real tall and it looks stupid. Is
> there some way to specify that the cell heights should be
> constant. I looked at the properties and nothing jumped
> out as an obvious answer. I have one template column with
> a checkbox in it and 5 databound columns.
> I hope the answer will be in VS.NET since I don't want to
> muck around with the html.
>
> Thanks,
> john
>