Hi!
These codes work without problem.
But in my .aspx file I put this code to paging my gridview. Unfortunatly, nothing happen. Sound like nothing is wrong there:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Paging" %>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">

Pankaj PandeyRank #642 · 3.7K reputationPosted Jul 23, 2013, 3:06 AM EDT
OnPageIndexChanging="GridView2_PageIndexChanging">
and then try your code
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 23, 2013, 1:36 AM EDT
You need to set like this
Regards,
Iftikar
Pankaj PandeyRank #642 · 3.7K reputationPosted Jul 23, 2013, 2:15 AM EDT
select gridview+go to property window+Change Allow paging from false to true.
and then try, hope it will work.
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 23, 2013, 2:26 AM EDT
1.
2. select gridview>go to property window>Change Allow paging from true
3. in .cs file after bind of gridview write this line of code.
GridView2.AllowPaging = true;
Divin Mfwamba22 reputationPosted Jul 23, 2013, 2:52 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 23, 2013, 2:57 AM EDT
in grid
OnPageIndexChanging="GridView2_PageIndexChanging">
protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
DataSet myDataSet = GetViewState();
DataTable myDataTable = myDataSet.Tables[0];
myGridView.DataSource = SortDataTable(myDataTable, true);
myGridView.PageIndex = e.NewPageIndex;
myGridView.DataBind();
}
Regards,
Iftikar