Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET VB.NET
how to enable paging for gridview in asp.net using vb.net code
Posted 1-Oct-11 1:28am
Comments
King_Fisher at 31-Jan-14 7:22am
   
got the answer?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

GridView Custom Paging[^]

Also Try this one.....Smile | :)

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

protected void grvDetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
       {
           grvDetails.PageIndex = e.NewPageIndex;
           bindGrid();
       }
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

select gridview ->goto properties window ->click on events button
 
double click on pageindexchanging event
 
and set
 
 Allowpaging=true for gridview
in pageindex changing event write the following code
gridview1.pageindex=e.newpageindex;
//gridbindingcode
gridview1.databind();
 
  Permalink  
Comments
v.sdivya at 1-Oct-11 10:35am
   
thank you...I tried with this coding, but next page is not getting loaded...I have used a single gridview for viewing details date wise(using calendar) and also for viewing fully.how to use paging here?
RAKESH CHAUBEY at 2-Nov-12 14:02pm
   
Plz Check allow paging is true or not .And Just for one time set page size =2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Set allowpaging property of grid view to true
 
and set pagesize property to no of records you want in each page.
 
in pageindex changing event write the following code
 
gridview1.pageindex=e.newpageindex;
 
gridview1.databind();
  Permalink  
v3
Comments
v.sdivya at 1-Oct-11 10:34am
   
thank you...I tried with this coding, but next page is not getting loaded...I have used a single gridview for viewing details date wise(using calendar) and also for viewing fully.how to use paging here?
v.sdivya at 2-Oct-11 16:00pm
   
Please reply .
RAKESH CHAUBEY at 2-Nov-12 14:01pm
   
grvDetails.PageIndex = e.NewPageIndex;
bindGrid();
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

In pge index changing event write the following code
 
protected void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
   gridView.PageIndex = e.NewPageIndex;
   gridView.DataBind();
}
  Permalink  
v2
Comments
v.sdivya at 1-Oct-11 10:35am
   
thank you...I tried with this coding, but next page is not getting loaded...I have used a single gridview for viewing details date wise(using calendar) and also for viewing fully.how to use paging here?
omarabbasaj at 6-Nov-13 4:16am
   
<asp:GridView AllowPaging="True|False" />
 

<%@ Page language="C#" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>GridView AllowPaging Example</title>
</head>
<body>
<form id="form1" runat="server">
 

GridView AllowPaging Example

 
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
allowpaging="true"
runat="server">
 
<pagersettings mode="Numeric"
position="Bottom"
pagebuttoncount="10"/>
 
<pagerstyle backcolor="LightBlue"
height="30px"
verticalalign="Bottom"
horizontalalign="Center"/>
 

 
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
<asp:sqldatasource id="CustomersSource"
selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server"/>
 
</form>
</body>
</html>
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 11

<asp:GridView ID="grd_EmployeeList" runat="server" AutoGenerateColumns="False" 
BackColor="White"
DataKeyNames="fEmpID" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="0px" CellPadding="3" CssClass="controlsFontStyle" ForeColor="Black" HeaderStyle-Height="22px" Height="22px" RowStyle-Height="22px" OnSelectedIndexChanging="SelectedIndexChanging_Click" OnRowCommand="OnRowCommand_Click" ShowHeaderWhenEmpty="True" Width="100%" PageSize="15" AllowPaging="True" EnableSortingAndPagingCallbacks="true" onpageindexchanging=" grd_EmployeeList_PageIndexChanging">
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 12

Simple Solution for grid view paging in asp.net c #
Example link
  Permalink  
Comments
Tadit Dash at 7-Jun-14 14:38pm
   
3 yr old question with many solutions.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 446
1 OriginalGriff 325
2 Yogesh Kumar Tyagi 304
3 Maciej Los 235
4 Prakriti Goyal 200
0 OriginalGriff 6,417
1 Sergey Alexandrovich Kryukov 5,344
2 Maciej Los 3,434
3 Peter Leow 3,259
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 7 Jun 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100