retrieve PageCount of DataGrid

Discussion in 'ASP .Net Web Controls' started by David Potahisnsky, Nov 7, 2003.

  1. I have ASPX page with DataGrid object. To fill this object I use DataTable

    that contain result of stored procedure. In my case it's about 300 rows.



    I would like to display this table with paging.



    This is code to retrieve table:



    DataTable dtMainTable = null;

    DataSet Ds = SqlHelper.ExecuteDataset(strConnectionString,

    CommandType.StoredProcedure, "a_test_procedure", null);

    Ds.Tables[0].TableName = "PermissonFunctions";

    dtMainTable = Ds.Tables[0];





    this is code for data bind of datagid:



    ReportGrid.DataSource = dtMainTable;

    ReportGrid.AllowPaging = true;

    ReportGrid.CurrentPageIndex = 0;

    ReportGrid.DataBind();







    This code displays cool table on ASPX page.



    My problem is that I need to display the total number of pages that could be
    displayed.



    I'm trying to use:



    ReportGrid.PageCount, but any time returns me zero (0). Please help me to

    retrieve PageCount.







    Thank you, David Potahinsky
    David Potahisnsky, Nov 7, 2003
    #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. David Potahisnsky

    retrieve PageCount of DataGrid

    David Potahisnsky, Nov 7, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    395
    David Potahisnsky
    Nov 7, 2003
  2. Dave

    Datagrid PageCount Nightmare!!

    Dave, Nov 13, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    1,565
  3. anon
    Replies:
    0
    Views:
    463
  4. George Smith
    Replies:
    2
    Views:
    1,421
    Alvin Bruney [MVP]
    Apr 27, 2007
  5. Franck
    Replies:
    4
    Views:
    9,193
    sangsharma
    Jun 29, 2007
Loading...

Share This Page