C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

How to give pagination for gridview?


Posted Date: 04 Dec 2008      Posted By: Prerana      Member Level: Bronze     Points: 1   Responses: 13



Plz explain




Responses

Author: Sanju    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

First of all. Set the AllowPaging = True for Gridview.

And then make the code like

Gridview1.CurrentPageIndex = e.NewPageIndex

on PageIndexChanged event of Gridview. and then Bind the gridview again.

Try this.



Author: indra sena reddy    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

in gridview properties

Set the AllowPaging = True for Gridview.

And then make the code like

Gridview1.CurrentPageIndex = e.NewPageIndex

on PageIndexChanged event of Gridview. and then Bind the gridview again.



Author: lalitha    04 Dec 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 3

For Gridview Paging you need to set allowpaging of Gridview property to true

AllowPaging="True"

and in pageindexchangingevent


protected void gvMycollections_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvMycollections.PageIndex = e.NewPageIndex;
bindgrid();
}
Whenever a new page is clicked PageIndex will change accordingly. Initially its value is -1

Hope this helps you
Regards
Lalitha



Author: Elz    04 Dec 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi

Set Allow Paging =True
And in Gridview's page index changing event
write below code
Gridview1.pageindex=e.pageindex
bind();//bind the query
Pager settings u can define page mode,size ....



Author: Abhishek Namdeo    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 3

Steps 1:
Make the AllowPaging property of gridview- true

Step 2:
Go to pager style property of gridview and set the property for the pager(If you need)

Step 3:
Set the PageSize property of gridview-5,10,20 as per your need

For more help check this link

http://www.codeproject.com/aspnet/SelChkboxesDataGridView.asp



Author: geetha    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

HI
Set Allow Paging=True
In PageIndexChanging event
Write like this
grdview.PageIndex = e.NewPageIndex;
Fillgrid();//bind the gridview



Author: geetha    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

HI
Set Allow Paging=True
In PageIndexChanging event
Write like this
grdview.PageIndex = e.NewPageIndex;
Fillgrid();//bind the gridview



Author: raj    04 Dec 2008Member Level: BronzeRating: 2 out of 52 out of 5     Points: 1

you can visit the following article for grid view

http://apnasaathi.blogspot.com/2006/09/datagrid.html



Author: Abhishek Namdeo    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 3

Steps 1:
Make the AllowPaging property of gridview- true

Step 2:
Go to pager style property of gridview and set the property for the pager(If you need)

Step 3:
Set the PageSize property of gridview-5,10,20 as per your need

For more help check this link

http://www.codeproject.com/aspnet/SelChkboxesDataGridView.asp



Author: Abhishek Namdeo    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 3

Steps 1:
Make the AllowPaging property of gridview- true

Step 2:
Go to pager style property of gridview and set the property for the pager(If you need)

Step 3:
Set the PageSize property of gridview-5,10,20 as per your need

For more help check this link

http://www.codeproject.com/aspnet/SelChkboxesDataGridView.asp



Author: Prerana    04 Dec 2008Member Level: BronzeRating: 2 out of 52 out of 5     Points: 0

Thanks a lot guys


Author: MVNSR PAVAN KUMAR    05 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 1

chek the link.it may help u out.
http://www.dotnetjunkies.ddj.com/Tutorial/AAF84EAD-C412-4304-A88A-AF26F8C883E6.dcik



Author: mohan    05 Dec 2008Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

Steps 1:
Make the AllowPaging property of gridview- true

Step 2:
Go to pager style property of gridview and set the property for the pager(If you need)

Step 3:
Set the PageSize property of gridview-5,10,20 as per your need



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : problem in dynamic created menu
Previous : I want to apply....
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use