I did the pagging through gridview properties :
and Use event to bind through data which will be displayed on next page :
protected void gridSection_PageIndexChanging(object sender, GridViewPageEventArgs e)
gridSection.PageIndex = e.NewPageIndex;
gridSection.DataSource = dal.SectionLoad();
I had 20 records and considering this their will be 10 record in each page as I set PageSize =10 but It shows 123 pages and 3rd page is empty .Can I do any thing to resolve it ?
And also can I fix the height according to PageSize,that will be constant if number of record is less then 10 in page
Repli me and thanks in advance
First thing first........check what data is returned by the database for ur query, i guess it's returning more then 20 records. Second run the solution in dubug mode check what is the content of your data table...! i'm sure you find solution for your multiple
This will help you
their is no multiple record but had a primary key entry without data in table which cause a third page .
Thanks alot for that and do I need to implement custome paging or that is enough ?
Coz i dont have any idea :(
No need for custom paging......! are you using SQL JOINS in your query.....?
can you Post your grid view desig page code......?
If you are fetching more than 500 records, then it is better to go for custom paging. Because with in-built page index every time u click on the page it will fetch all the records from your database which is time consuming