Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount in asp.net

Discussion in 'Software' started by yakoobismail, May 22, 2009.

  1. yakoobismail

    yakoobismail

    Joined:
    May 22, 2009
    Messages:
    1
    i got error in datagrid. suppose i moved one page to another page in datagrid. This type of the error should come. how i will solve that one.

    This is my coding


    <asp:DataGrid ID="gridedit" runat="server" Width="100%" DataKeyField="CountryID" BorderStyle="Ridge"
    GridLines="None" BorderWidth="2px" CellPadding="3"
    CellSpacing="1" AllowSorting="True" PagerStyle-HorizontalAlign="Center" HorizontalAlign="Left"
    OnPageIndexChanged="gridedit_PageIndexChanged"
    PageSize="20" AllowPaging="True"
    AutoGenerateColumns="False" SelectedItemStyle-Width="100px" OnSelectedIndexChanged="gridedit_SelectedIndexChanged">
    <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#A53A6A"></HeaderStyle>
    <FooterStyle BackColor="Beige" ForeColor="Black" />
    <PagerStyle Font-Bold="True" Mode="NumericPages" Font-Underline="True" HorizontalAlign="Center" />

    <Columns>
    <asp:BoundColumn DataField="CountryID" Visible="False" HeaderText="RegID">
    <itemstyle backcolor="GhostWhite" />
    <HeaderStyle BackColor="#0793CF" Font-Bold="True" />
    </asp:BoundColumn>
    <asp:BoundColumn DataField="JobID" HeaderText="JobID">
    <itemstyle backcolor="GhostWhite" />
    <HeaderStyle BackColor="#0793CF" Font-Bold="True" />
    </asp:BoundColumn>

    <asp:BoundColumn DataField="FirstName" HeaderText="FirstName">
    <itemstyle backcolor="GhostWhite" />
    <HeaderStyle BackColor="#0793CF" Font-Bold="True" />
    </asp:BoundColumn>

    <asp:BoundColumn DataField="EmailId" HeaderText="EmailId">
    <itemstyle backcolor="GhostWhite" />
    <HeaderStyle BackColor="#0793CF" Font-Bold="True" />
    </asp:BoundColumn>

    <asp:BoundColumn DataField="AreaofExpertise" HeaderText="AreaofExpertise">
    <itemstyle backcolor="GhostWhite" />
    <HeaderStyle BackColor="#0793CF" Font-Bold="True" />
    </asp:BoundColumn>
    <asp:BoundColumn DataField="ExeperienceLevel" HeaderText="ExeperienceLevel">
    <itemstyle backcolor="GhostWhite" />
    <HeaderStyle BackColor="#0793CF" Font-Bold="True" />
    </asp:BoundColumn>

    <asp:TemplateColumn HeaderText="Country" Visible="False">
    <ItemStyle HorizontalAlign="Left" Wrap="False" />
    <HeaderStyle ForeColor="White" HorizontalAlign="Left" BackColor="#0793CF" Font-Bold="True" />
    <ItemTemplate>
    <asp:Label ID="lnkCountry" runat="server" Visible="false" Text='<%# Bind("CountryName") %>'></asp:Label>&nbsp;
    </ItemTemplate>


    </asp:TemplateColumn>

    <asp:TemplateColumn HeaderText="View Resume">
    <HeaderStyle ForeColor="White" HorizontalAlign="Left" BackColor="#0793CF" Font-Bold="True" />
    <itemstyle backcolor="GhostWhite" HorizontalAlign="Left" Wrap="False" />
    <ItemTemplate>
    <asp:Label ID="lnkName" runat="server" Text='<%# Bind("ResumefilePath") %>'></asp:Label>&nbsp;
    <asp:HyperLink ID="lBtnResumefileAttachment" runat="server" ImageUrl="~/images/paperclip_blue.gif"
    NavigateUrl='<%# "../UpLoadResume"+ Eval("CountryName")+"/"+ Eval("ResumefilePath") %>' Text='<%# Bind("ResumefilePath") %>'></asp:HyperLink>

    </ItemTemplate>


    </asp:TemplateColumn>


    </Columns>
    <SelectedItemStyle Width="100px" />
    </asp:DataGrid>
    yakoobismail, May 22, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2FuanU=?=

    information about asp ,oracle,asp.net certification?

    =?Utf-8?B?c2FuanU=?=, May 18, 2005, in forum: Microsoft Certification
    Replies:
    1
    Views:
    497
    Bob Christian
    May 18, 2005
  2. Daniel Joskovski

    Re: Problems facing in datagrid pagecount

    Daniel Joskovski, Apr 7, 2004, in forum: MCSD
    Replies:
    0
    Views:
    452
    Daniel Joskovski
    Apr 7, 2004
  3. Daniel Joskovski

    Re: Problems facing in datagrid pagecount

    Daniel Joskovski, Apr 8, 2004, in forum: MCSD
    Replies:
    0
    Views:
    494
    Daniel Joskovski
    Apr 8, 2004
  4. london1919
    Replies:
    1
    Views:
    2,874
    Lawrence Garvin \(MVP\)
    Dec 8, 2008
  5. priyajee
    Replies:
    2
    Views:
    4,780
    article
    Dec 9, 2009
Loading...

Share This Page