Page index in DataGrid

Last post 05-12-2008 6:40 AM by Sithara. 5 replies.

Sort Posts:

  • Page index in DataGrid

    05-12-2008, 2:50 AM
    • Loading...
    • Sithara
    • Joined on 04-22-2008, 6:34 AM
    • Posts 34

     Hi all,

               In the datagrid page indexing was  not workong properly.I cant identify which page is selected .Otherwise its works properly.Waiting for your reply.

     <asp:GridView ID="gdvJournals"  runat="server" ShowHeader="False" Width="100%" BorderWidth="0px"
                        BorderStyle="None" AutoGenerateColumns="False" CellPadding="6" AllowPaging="True" OnPageIndexChanging="gdvJournals_PageIndexChanging" PageSize="3">
                        <Columns>

    Thanks in advance
     

  • Re: Page index in DataGrid

    05-12-2008, 3:24 AM
    • Loading...
    • anzer
    • Joined on 10-19-2004, 12:00 AM
    • UAE
    • Posts 566

    protected void gdvJournals_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gdvJournals.PageIndex = e.NewPageIndex;
            loadYouJournalAgain();
        }

     Make sure the enablepaging property set to true
     

    If this post was useful to you, please mark it as answer. Thanks

    My Blog
  • Re: Page index in DataGrid

    05-12-2008, 3:25 AM
    • Loading...
    • Talib_dotnet
    • Joined on 01-31-2008, 6:02 AM
    • Riyadh , K.S.A
    • Posts 109

    Hi  Sithara,

    Set  the  property  EnableSortingAndPagingCallbacks to True...

    This  should  solve  your  problem...

    Click "Mark As Answer" if it helped you.


    TALIB ALI KHAN
    MCTS
    Welcome to TALIB's World



  • Re: Page index in DataGrid

    05-12-2008, 3:25 AM
    • Loading...
    • aspro
    • Joined on 04-15-2008, 1:29 AM
    • Australia
    • Posts 24

    What errors are you getting? what do you have in your code behind? Please post some more information.

    aspro 

    Please mark your posts as answered and thank the asp gods of the forum
  • Re: Page index in DataGrid

    05-12-2008, 3:40 AM
    • Loading...
    • kalyan1982
    • Joined on 04-10-2008, 8:28 AM
    • Johannesburg, South Africa
    • Posts 70

    Hey,

     Add this code in your code behind page. This may help you solve your problem.

    Private Sub gdvJournals_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles gdvJournals.PageIndexChanged

    gdvJournals.CurrentPageIndex = e.NewPageIndex

    FillGridView()  ' The function to fill your gridview

    End Sub

    Kalyan Krishna.B
    (.NET Developer)

    Email: kalyandotnetdeveloper@gmail.com
  • Re: Page index in DataGrid

    05-12-2008, 6:40 AM
    Answer
    • Loading...
    • Sithara
    • Joined on 04-22-2008, 6:34 AM
    • Posts 34

     Hi all,

               Problem is in master page I solved it.

     

    Thanks
     

Page 1 of 1 (6 items)