Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resizing gridviews

Status
Not open for further replies.

citizenzen

Programmer
Jun 28, 2007
102
US
Hello.

I am using c# and as I am wrapping upi my project, i have to make sure that the GridViews resize if the user minimizes or resizes the page. How can i accomplish this task?

here's an example of what i have, but it doesn't seem to work if the user resizes the page:
Code:
     <asp:GridView ID="MasterGridGV" runat="server" CellPadding="4"  DataKeyNames="SubNum" DataSourceID="DubsDetDS" ForeColor="#333333" BorderWidth="1px" BorderColor="#cccccc" GridLines="None" AutoGenerateColumns="False" Width="100%" HeaderStyle-Wrap="true" PagerStyle-Wrap="true">

DATA HERE....

  </asp:GridView>
 
GridView controls render as a table. So, if your table, rows or cells have fixed widths, then it will not resize. If they have percentage based widths or they are not defined (but the actual table is set to a percentage) then they will resize.


------------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
 
i revised the gridviews and set their width to 100%, but if the user resizes the page to a smaller size (which i am tasked to implement), the grid doesn't really resize. is there anything else that can be done? my director is looking for something akin to google and I am not sure if that concept uses javascript or what...
 
citizenzen said:
grid doesn't really resize
it either does or doesn't. computers can't program for "sometimes" :)

you'll need to a solid understanding of css to pull this off. maybe even some js to set properties. my css skills are novice at best, but I do know that to resize a given node the parent node must also have the demisions set. this means starting with body{width:100%} and working your way down the tree.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top