473,395 Members | 2,079 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,395 software developers and data experts.

Datagrid not sized for number of items. Trying to use Flow Layout, affecting row height.

Kat
Hi, I'm trying to set up an asp.net page using flow layout so I'm
putting all my controls into a table grid, etc. I use several
radiobuttonlists and datagrids that are generated from datasource. The
radiobuttonlists are fine, they size depending on how many item are
called into it.

However, the datagrids, prior to filling with data contain FIVE
"Databound" items and the grid does not shrink if it is filled with
only 2 for example. Therefore, the table row height reflects the five
"databound" columns and not the dynamically filled datagrid.

Am I making any sense? I'm simply getting a dataset which is a dollar
amount, selecting the ItemPrice field in the datagrid's property
builder, and formatting it {0:c}, binding the dataset to my datagrid.

Any suggestions as to how I can work around this, or am I simply doing
something wrong? And, of course, if so -- what?

Thanks,
Kat
Nov 18 '05 #1
5 1863
Kat, not totally sure I understand, but can you just set "visible=false" for
the columns you don't use?

Bill

"Kat" wrote:
Hi, I'm trying to set up an asp.net page using flow layout so I'm
putting all my controls into a table grid, etc. I use several
radiobuttonlists and datagrids that are generated from datasource. The
radiobuttonlists are fine, they size depending on how many item are
called into it.

However, the datagrids, prior to filling with data contain FIVE
"Databound" items and the grid does not shrink if it is filled with
only 2 for example. Therefore, the table row height reflects the five
"databound" columns and not the dynamically filled datagrid.

Am I making any sense? I'm simply getting a dataset which is a dollar
amount, selecting the ItemPrice field in the datagrid's property
builder, and formatting it {0:c}, binding the dataset to my datagrid.

Any suggestions as to how I can work around this, or am I simply doing
something wrong? And, of course, if so -- what?

Thanks,
Kat

Nov 18 '05 #2
Kat,

Probably you have set the height attribute for the grid to an absolute
value. You should leave it automatic and then the grid will size itself
nicely. If you want the grid to look bigger than it is, you can achieve this
buy setting the grid's container (a cell, div etc.) background color to the
same color as the grid's background and setting grid's border to 0.

Eliyahu

"Kat" <ka**********@comcast.net> wrote in message
news:62*************************@posting.google.co m...
Hi, I'm trying to set up an asp.net page using flow layout so I'm
putting all my controls into a table grid, etc. I use several
radiobuttonlists and datagrids that are generated from datasource. The
radiobuttonlists are fine, they size depending on how many item are
called into it.

However, the datagrids, prior to filling with data contain FIVE
"Databound" items and the grid does not shrink if it is filled with
only 2 for example. Therefore, the table row height reflects the five
"databound" columns and not the dynamically filled datagrid.

Am I making any sense? I'm simply getting a dataset which is a dollar
amount, selecting the ItemPrice field in the datagrid's property
builder, and formatting it {0:c}, binding the dataset to my datagrid.

Any suggestions as to how I can work around this, or am I simply doing
something wrong? And, of course, if so -- what?

Thanks,
Kat

Nov 18 '05 #3
After playing with it some more, I think I can explain it more simply...

An html table row has a datagrid in it.

I do not set the datagrid control's height.

The hmtl table row (in the html page) automatically sets its height to
match that of the empty five-row datagrid, and just comes back when I
delete the height.

When the datagrid is empty (no dataset), I set it to visible=false.

The html row height stays as large as if the datagrid was populated and
visible...blank but the space is still there.

Driving me nuts!!!

Thanks, Kat

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4

"KatB" <no****@comcast.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
After playing with it some more, I think I can explain it more simply...

An html table row has a datagrid in it. You mean an html cell (<td>)

I do not set the datagrid control's height.

The hmtl table row (in the html page) automatically sets its height to
match that of the empty five-row datagrid, and just comes back when I
delete the height. The row height is calcilated automatically to accomodate the cell content.
How can an empty datagrid be five-row one? If it has no rows and the height
is not set it should have the height of the header (plus the borders,
paddings, margins), no room should be allocated for empty rows. What do you
mean by "delete the height"? Did not you say you didn't set the datagrid
height?

When the datagrid is empty (no dataset), I set it to visible=false.

The html row height stays as large as if the datagrid was populated and
visible...blank but the space is still there.

Driving me nuts!!!

Thanks, Kat

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #5
Resolved. I hadn't realized that every time I touched the datagrid in
design view, it automatically put back a height measurement in the HMTL.
Every datagrid I have is a five-row list of DataBound, DataBound, etc.
So initially, the HTML was calculating on that.

I went back and removed EVERY height attribute in my HTML tables and all
is well.

Thanks for your help!
Thanks, Kat

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #6

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

Similar topics

5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
0
by: Serdar Kalaycý | last post by:
I have a DataGrid in my WebForm. I set its Height propert to 1px because if I give it a big number and there's less records then expected, it extends the rows giving a silly layout. So it gets...
5
by: AC | last post by:
Any reason i'm having trouble with: DataGrid1.Columns(7).ItemStyle.HorizontalAlign = HorizontalAlign.Right I'm trying to directly set the column alignment of a datagrid created at runtime.. ...
0
by: Danny | last post by:
I am trying to sort my second datagrid. And it works but only after i click 2 times on the column header. The first time i click on the header the data in the right order will add to the rows in...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
7
by: Chris Nelson | last post by:
I'm new to the positioning aspects of CSS and I'm going crazy trying to do something that seems like it should be fairly easy. I've Googled all over and read CSS tutorials and not found an answer....
1
by: marcbb | last post by:
Hi all, I have a really strange problem working with Dropdownlists in a DataGrid. I'm trying to preselect some values from the DropDownlist for each row in the DataGrid, but it seems that...
1
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.