View Single Post
Old January 31st, 2008, 08:38 AM
Rich57 Rich57 is offline
Authorized User
Join Date: Sep 2007
Location: Rugeley, , United Kingdom.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB Ch7 p247 Try It Out Using DetailsView

After applying the various Errata comments to this exercise, I managed to complete it but found that the Pager Settings Mode didn't work as expected. In step 4, we set NumericFirstLast, but the result viewed in the browser is the same as Numeric - the FirstPageText and LastPageText values are ignored. The alternative setting NextPreviousFirstLast displays the PageText values as expected. Why not NumericFirstLast?

Here is my code:
<%@ Page Language="VB" MasterPageFile="~/site.master" AutoEventWireup="false" CodeFile="Fixtures-Stacked.aspx.vb" Inherits="Fixtures_Stacked" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:detailsview ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
        DataKeyNames="FixtureID" DataSourceID="SqlDataSource1" Height="50px" Width="350px">
        <pagersettings FirstPageText="First Game of the Season" LastPageText="Last Game of the Season" />
            <asp:boundfield DataField="FixtureID" HeaderText="FixtureID" InsertVisible="False"
                ReadOnly="True" SortExpression="FixtureID" />
            <asp:boundfield DataField="FixtureDate" HeaderText="FixtureDate" SortExpression="FixtureDate" />
            <asp:boundfield DataField="FixtureType" HeaderText="FixtureType" SortExpression="FixtureType" />
            <asp:boundfield DataField="GoalsFor" HeaderText="GoalsFor" SortExpression="GoalsFor" />
            <asp:boundfield DataField="GoalsAgainst" HeaderText="GoalsAgainst" SortExpression="GoalsAgainst" />
            <asp:boundfield DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
            <asp:boundfield DataField="Opponents" HeaderText="Opponents" SortExpression="Opponents" />
    <asp:sqldatasource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WroxUnited %>"
        SelectCommand="SELECT * FROM [Fixtures]"></asp:sqldatasource>
Rugeley, UK
WinXP Pro SP2
VBW Express
Rugeley, UK
WinXP Pro SP2
VBW Express + SQL Server 2005 Express