Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 9th, 2008, 02:05 PM
Friend of Wrox
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default GridView and page size

I am using a GridView with a page size of 10. If I have 10 rows bound to the grid, the layout of the page is correctly proportioned and spaced. (I am using Master Page and ContentPlaceHolder). If I have for example only 5 rows, then everything is displayed in the middle of the page and not starting from the top (I guess something to do with relative positioning). How can I get the page to work and always start positioning at the top. Is there a property setting in the GridView that will allow to fill grid with blank lines if less than page size?

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="PropSale.aspx.vb" Inherits="PropSale" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Label ID="Label1" runat="server" BackColor="Red" BorderStyle="None" Font-Size="X-Large"
        Style="left: 284px; vertical-align: middle; border-top-style: none; border-right-style: none;
        border-left-style: none; position: relative; top: 11px; text-align: center; border-bottom-style: none"
        Text="Propellers for Sale" Width="290px"></asp:Label>
    <asp:Label ID="Label2" runat="server" BorderStyle="None" Font-Size="Medium" Style="left: -260px;
        position: relative; top: 58px" Text="Select size" Width="72px"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server" Style="left: -260px; position: relative;
        top: 62px" Width="99px" BackColor="#FFFFC0"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" BackColor="Silver" Style="left: -255px; position: relative;
        top: 64px" Text="Search" Width="85px" />&nbsp;
    <asp:LinkButton ID="LinkButton1" runat="server" BackColor="White" BorderStyle="None"
        Height="18px" PostBackUrl="~/Contact.aspx" Style="left: -183px; position: relative;
        top: 60px" Width="209px">Contact us for price (click here)</asp:LinkButton>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
        BorderStyle="Solid" CellPadding="8" Font-Size="Small" Height="114px" HorizontalAlign="Left"
        Style="left: 25px; position: relative; top: 82px" Width="749px">
        <RowStyle Wrap="False" />
        <HeaderStyle BackColor="#C0FFFF" BorderStyle="Solid" Font-Size="Small" HorizontalAlign="Center" />
        <AlternatingRowStyle BackColor="#FFFFC0" Font-Size="Small" HorizontalAlign="Left" />
Reply With Quote
  #2 (permalink)  
Old January 11th, 2008, 08:54 AM
Authorized User
Join Date: Jan 2007
Location: Islamabad, Punjab, Pakistan.
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84

Dear just make your gridview's valign property to top.
Hope it will work otherewise make your content1 to valign top too.

Ali Irfan
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Size HelmutArnold Reporting Services 0 October 6th, 2006 08:47 AM
Window or Page size ckrajeshvarma ASP.NET 2.0 Professional 0 August 6th, 2006 12:53 AM
CrystalReportViewer : page size problem kriangsak Crystal Reports 0 December 20th, 2005 02:52 AM
page size treasacrowe Classic ASP Basics 4 September 6th, 2004 02:25 AM
Checking page size in kb G Classic ASP Basics 1 September 24th, 2003 02:47 AM

All times are GMT -4. The time now is 12:37 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.