Wrox Programmer Forums
|
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 January 9th, 2008, 02:05 PM
Friend of Wrox
 
Join Date: Mar 2007
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?

Code:
<%@ 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" />
    </asp:GridView>
</asp:Content>
 
Old January 11th, 2008, 08:54 AM
Authorized User
 
Join Date: Jan 2007
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84
Default

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

Regards,
Ali Irfan





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





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