Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 3rd, 2006, 11:35 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default Vertically Constrain GridView

What are some approaches for vertically constraining a gridview? I dropped one on a page as a test and it extended down the full length of the datasource. I'd like to have it fit within a "frame" (I'm not sure it will be a "real" frame) like a sub-page on a larger page. Should I put it in a user control? What are some other approaches?

Thanks!
 
Old February 4th, 2006, 05:06 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It depends on what you want it to do when more data must be displayed then your "viewport" allows.

You could wrap the control inside a <div> with a fixed width and height and its overflow set to auto. Once the Grid is bigger than the <div> you'll see scroll bars appear.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 6th, 2006, 06:15 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 Thanks for your message. I'd like scroll bars. I tried this:

<div style ="overflow:auto; height:510px; width:500px" >
    <asp:GridView ID="GridView1" runat="server"
        (gridview stuff)
    </asp:GridView>
</div>

but still shows a vertically lonngggg gridview. Did I miss something?
 
Old February 6th, 2006, 06:53 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

oops! I had a style line in the gridview header...it overrode the div. Took it out and voila...Scroll bars!

Dank!





Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSet Column with Unique Constrain Problem niceFEPF C# 5 July 31st, 2009 07:04 PM
Vertically aligning divs in Opera ceadge CSS Cascading Style Sheets 0 August 23rd, 2006 08:10 PM
Moving vertically on a form penta Access 5 June 2nd, 2005 07:55 AM
display DataGrid column headers vertically neethling ASP.NET 1.0 and 1.1 Professional 0 May 13th, 2004 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.