Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 允许对gridview进行分页_C#_Visual Studio 2008 - Fatal编程技术网

C# 允许对gridview进行分页

C# 允许对gridview进行分页,c#,visual-studio-2008,C#,Visual Studio 2008,我有以下gridview并希望启用分页 <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" Height="168px" BorderStyle="Solid" Width="120%" PageSize="5" AllowPaging="true"

我有以下gridview并希望启用分页

<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" 
        GridLines="None" AutoGenerateColumns="False" Height="168px" BorderStyle="Solid" 
         Width="120%" PageSize="5" AllowPaging="true" 
         >
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:BoundField DataField="ActionDate" HeaderText="Action Date" />
            <asp:BoundField DataField="CustomerFirstName" HeaderText="Name" />
            <asp:BoundField DataField="CustomerLastName" HeaderText="Last Name" />
            <asp:BoundField DataField="CustomerCompany" HeaderText="Company/Organisation" />
            <asp:BoundField DataField="CustomerPosition" HeaderText="Position" />
            <asp:BoundField DataField="CustomerCountry" HeaderText="Country" />
            <asp:BoundField DataField="CustomerProvince" HeaderText="Province" />
            <asp:BoundField DataField="CustomerContact" HeaderText="Contact" />
            <asp:BoundField DataField="CustomerEmail" HeaderText="Email Address" />
            <asp:BoundField DataField="ProductCode" HeaderText="Product code" />
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>

我如何处理此网格视图的分页事件

请阅读本文:

在本文中,您可以逐步了解如何在ASP.NET中实现分页

特别是,请查看您是否有此类事件处理程序背后的代码:

protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
可能重复:希望对您有所帮助。请参阅。似乎需要在代码中添加PageIndexChange事件
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)