retrieve PageCount of DataGrid

  • Thread starter David Potahisnsky
  • Start date
D

David Potahisnsky

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top