473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

retrieve PageCount of DataGrid

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
Jul 21 '05 #1
0 1468

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Meg | last post by:
Hi All, I am having a problem with paging in datagrid and need some idea as to how to handle the problem 1. the datagrid is first filled with a select * all 2. the datgrid shows 10 pages...
0
by: David Potahisnsky | last post by:
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...
4
by: Dave | last post by:
Hello All, I am having a nightmare trying to add a new row to my Datagrid. When I use the code below I get the error: 'Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. Can...
3
by: Alex | last post by:
How can I retrieve a DataRow from the DataGrid in the update handler? Can I do this or do I need to construct one?
0
by: anon | last post by:
Hi All, tried implementing the custom paging solution from 4 guys from rolla...however the pagecount in my implementation always returns one, so the postback gives an error asying"CurrentPageIndex...
1
by: Linda | last post by:
Hi, I'm new to asp.net and tryign to learn how to work with data grids. I'm retrieving data from a stored procedure and putting it in a data grid. I then want to be able to sort the data when...
3
by: Franck | last post by:
Hello, in a datagrid, in the ItemDataBound event in some cells a add some javascript that show up an information strHref.Append("<A onclick=\"popupValid();\">"); strHref.Append("<span...
0
by: Thomas Wopienka | last post by:
Hello! I've found several articles about sending PCL or PJL commands to a printer to query the pagecount. One of the articles was about querying the pagecount of a printer but only the PJL...
1
by: prajin | last post by:
i have to retrieve hidden data from gridview. hidden data is Usr_No. then i need to update the record based on that condition. now i am getting the hidden data. but only first record is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.