Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

sizeable grid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jesse Aufiero - 18 Oct 2005 21:12 GMT
I was wondering if anyone knows how to get a datagrid to size as the browser
is resized such that the datagrid's borders would appear anchored to the
browser edges.  The datagrid should have a white-space border around it and
scrollbars should automatically appear on the datagrid should the contents
of the grid spill outside of the viewable area.

I have gotten this to work for the IE browser by placing a DIV tag around
the datatable (shown below).  And to maintain a margin of white space around
each edge of the grid as the browser is resized, I placed the DIV section
inside of a table, with rows and columns that maintain the white-space
margin around the grid, and whose center cell is set to a height and width
of 100%.

a snippet...

<TD align="right" width="100%" height="100%">

   <DIV style="OVERFLOW: auto; WIDTH: 100%; HEIGHT: 100%">

       {Datatable}

   </DIV>

</TD>

...but this code does not work in a Mozilla/Firefox browser.  Instead, the
datagrid extends well beyond the browser's right and bottom edges, causing
unwanted browser scrollbars to appear.

I know there must be a way around this, perhaps by using style sheets.  But
I'm not sure what next steps to take.
S. Justin Gengo - 18 Oct 2005 21:36 GMT
Jesse,

Set the grids contents to allow wrapping and then set the grid's width to a
percentage.

Signature

Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
                           Nietzsche

>I was wondering if anyone knows how to get a datagrid to size as the
>browser is resized such that the datagrid's borders would appear anchored
[quoted text clipped - 27 lines]
> I know there must be a way around this, perhaps by using style sheets.
> But I'm not sure what next steps to take.
Jesse Aufiero - 18 Oct 2005 21:44 GMT
Unfortunately one of my requirements, for reasons of legibility, is to leave
the grids contents unwrapped.  Hence the need for scrollbars when the
contents of the grid inevitably extend beyond the viewable area.

> Jesse,
>
[quoted text clipped - 32 lines]
>> I know there must be a way around this, perhaps by using style sheets.
>> But I'm not sure what next steps to take.
Bruce Barker - 19 Oct 2005 00:34 GMT
this is a bug in IE, might be fixed in the next release.

while the browser tries to make the body width equal the frame width, it
makes no attempt on the height. thus on the <div style="height=100%;">, it
is setting the div's height to the parents height. in this case the parent
is the body, whose height is auto (size of content), this make the div's
height auto also, so no scrollbars are needed. you to need to set the height
of the div parents, so that it can calc a size smaller than the frame.

add this line:

<style type="text/css">html, body{height:100%}</style>

-- bruce (sqlwork.com)

>I was wondering if anyone knows how to get a datagrid to size as the
>browser is resized such that the datagrid's borders would appear anchored
[quoted text clipped - 27 lines]
> I know there must be a way around this, perhaps by using style sheets.
> But I'm not sure what next steps to take.
Jesse Aufiero - 19 Oct 2005 13:19 GMT
IE renders it fine... it's Mozilla/Firefox that I'm having trouble with.

> this is a bug in IE, might be fixed in the next release.
>
[quoted text clipped - 43 lines]
>> I know there must be a way around this, perhaps by using style sheets.
>> But I'm not sure what next steps to take.
Juan T. Llibre - 19 Oct 2005 14:09 GMT
You might want to take a look at this free article
"Rendering to Firefox from ASP.NET" :
http://asptoday.com/Content.aspx?id=2339

Also, make sre your web.config has the updated Mozilla/Firefox entries :
http://slingfive.com/pages/code/browserCaps/

the actual text which needs to be included in web.config is at :
http://slingfive.com/pages/code/browserCaps/browserCaps_spaces.txt

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
> IE renders it fine... it's Mozilla/Firefox that I'm having trouble with.

>> this is a bug in IE, might be fixed in the next release.
>>
[quoted text clipped - 41 lines]
>>> I know there must be a way around this, perhaps by using style sheets. But I'm not
>>> sure what next steps to take.
Jesse Aufiero - 19 Oct 2005 14:34 GMT
Thanks for the comprehensive answer.  Had I asked you a few days ago I could
have saved myself hours of google searches.  But actually, I have already
seen all three of these pages and, after applying what I learned from them,
I'm still having issues.  I'm not quite sure what to do next here.  But
thank you for the info.

Probably what I need is someone who has gone through this exact problem
before, but finding that person will be hard.

> You might want to take a look at this free article
> "Rendering to Firefox from ASP.NET" :
[quoted text clipped - 60 lines]
>>>> I know there must be a way around this, perhaps by using style sheets.
>>>> But I'm not sure what next steps to take.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.