473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to align items vertically on a datagrid

Hi, I'm working with .net version 1.1.

I've got a datagrid on a webform that my users want a fixed height, which is
fine. It can contain up to 10 records. If there are 10 records then it's fine
and looks very nice. However if there is only 1 record (or just a few) then
it looks daft, because the records aren't vertically aligned at the top.

I can't find a vertical alignment property for a datagrid. Is there a way of
working this so that the records will always be placed at the top?

Thanks
Juia
Jan 29 '08 #1
3 1469
Don't set any height attribute for the grid and it will align the rows
nicely. Instead, put the grid in a <divand set the height for the div. You
can create an impression that the grid fills up the whole height of the
<diveven if it has less than 10 records by setting the same background
color for the grid and the <div>.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Julia B" <Ju****@discussions.microsoft.comwrote in message
news:B7**********************************@microsof t.com...
Hi, I'm working with .net version 1.1.

I've got a datagrid on a webform that my users want a fixed height, which
is
fine. It can contain up to 10 records. If there are 10 records then it's
fine
and looks very nice. However if there is only 1 record (or just a few)
then
it looks daft, because the records aren't vertically aligned at the top.

I can't find a vertical alignment property for a datagrid. Is there a way
of
working this so that the records will always be placed at the top?

Thanks
Juia

Jan 30 '08 #2
How about padding the datagrid to ten items with blanks?

Andrew
Jan 30 '08 #3
Good idea and thanks to both of you for that.

"Andrew Morton" wrote:
How about padding the datagrid to ten items with blanks?

Andrew
Jan 30 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: A.Translator | last post by:
From what I read, aligning images vertically in a div is not easy. It proofed too difficult for me: I tried to align the "control buttons" on the right hand side of the main nav bar by vertically...
0
by: Alan Silver | last post by:
Hello, I'm sure this is obvious, but it's driving me mad!! I have a DataList, and I want to have the contents of each cell centred and vertically aligned to the bottom of the cell. I have tried...
4
by: Tmuld | last post by:
Hello, I have a page that needs to only show 1 record at a time - but there are many fields - I want to display it vertically instead of hornizonatlly. The headers will run vertically as...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
1
by: Rabbit | last post by:
Dear All I'm new to use ASP.Net for developement, can someone tell me how can I create a web form with size say 300px x 300px, align vertically center on the page Because so far I can use Div...
4
by: avi | last post by:
Hello, I am trying to vertically center text in a background image, I found a solution on this site that sets the line-height to the height of the background image. This works just fine, except...
8
by: Dave Rado | last post by:
Hi See my mock-up at http://tinyurl.com/35tv29. The three icons are supposed to be vertically aligned on their bottoms (using "vertical- align: bottom"), but they aren't, they're vertically...
40
by: maya | last post by:
hi, how do I get text to vertical-align inside a div? http://www.mayacove.com/misc/home.html vertical-align should work, according to this:...
8
by: Patrick | last post by:
Hello, I'm trying to align a text vertically in a link displayed as a block. But the text is always at top. Is there a solution? Your advices are welcome. Here is a test page: <html>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.