Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Datagrid not sized for number of items. Trying to use Flow Layout, affecting row height.

Reply
Thread Tools

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

 
 
Kat
Guest
Posts: n/a
 
      10-20-2004
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmlsbCBCb3Jn?=
Guest
Posts: n/a
 
      10-20-2004
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
>

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      10-21-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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



 
Reply With Quote
 
KatB
Guest
Posts: n/a
 
      10-21-2004
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!
 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      10-21-2004

"KatB" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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!



 
Reply With Quote
 
KatB
Guest
Posts: n/a
 
      10-21-2004
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query:difference between node flow and filter flow in java's I/O,system? Jack Dowson Java 0 05-07-2007 03:35 PM
Oddly sized sized password textbox thechaosengine ASP .Net 1 09-15-2005 07:34 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
Trying to get Enter or up/down arrow keys to move row to row in asp.net datagrid sauce ASP .Net Datagrid Control 0 04-12-2005 03:22 AM
Referencing Dataset row not Datagrid row Craig ASP .Net 2 11-02-2004 05:27 PM



Advertisments