Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 9th, 2004, 01:13 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default equal spacing b/w rows in datagrid possible?

Hi-
I am using a datagrid with 10 record on each page. If the number of records are less than 10, the rows are widely spaced. Is it possible to make the spacing between rows constant?


 
Old September 9th, 2004, 01:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Have you tried setting the height of the datagrid?

J
 
Old September 9th, 2004, 01:57 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What should I set it to. It is set to 272px right now. But the problem is with the rows within the datagrid.
Thanks


 
Old September 9th, 2004, 02:31 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok. I got it done by using the itemstyle-height property for each column in the datagrid.
Thanks for looking into it though.



 
Old September 9th, 2004, 04:03 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you set and explicit height for the grid, it will expand the rows to fill the height. Thus, then you have less than the max row count per page, you'll have taller rows than normal. Either do not set the height of the grid or set an explicit height for the items as you have done.
 
Old September 9th, 2004, 04:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

OK, well I haven't had to format a datagrid's height, but it is just a table, right? So if you set the height to something low, say 100px, then it should auto expand for each row that is added, but not fill the entire page until you get enough rows to reach it.

Haven't tried it and if you want formatting on a per row basis it probably isn't the way to go, but if all you want is for it to not expand the rows the height of the page I think it should work.

J
 
Old September 9th, 2004, 06:07 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

if I were you I would act like katsarosj,
set the Height of your grid to 1px not 0px or empty


--------------------------------------------
Mehdi.:)
 
Old September 10th, 2004, 11:22 AM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That was an easy solution. I set the datagrid height to 0 and got the desired result. Thanks.


 
Old September 10th, 2004, 01:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Quote:
quote:Originally posted by planoie
 Either do not set the height of the grid or set an explicit height for the items as you have done.
I overlooked this when I originally posted this, but Peter is basically saying the same thing. When you added the datagrid, you must have dragged the height or set it initially - my guess. If you just add a datagrid from the toolbar, the height should not be specified.

My suggestion would be more useful if there was a certain height that you didn't want it to fall under. Otherwise, just don't set it (delete the height and you should get the same result).

J
 
Old September 19th, 2004, 08:48 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by katsarosj


My suggestion would be more useful if there was a certain height that you didn't want it to fall under. Otherwise, just don't set it (delete the height and you should get the same result).
No,its Highly recommended you set it,consider situations you put your grid inside another complicated Table ....
set the height of your grid(<Table> tag)to the minimum value that 1px would be the best one it assure you the height of your grid is the same as total heights of your rows(I saw somewhere even 0px doesnt work correctly but no problem with 1px)...

--------------------------------------------
Mehdi.:)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting rows not equal to specific values Oprete Excel VBA 1 March 25th, 2007 11:14 PM
Moving rows up and Down in Datagrid Baby_programmer ASP.NET 1.0 and 1.1 Professional 5 August 20th, 2006 04:14 AM
rows in Datagrid drachx General .NET 0 October 20th, 2004 08:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.