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 PandeyPosted Jul 23, 2013, 7:06 AM
OnPageIndexChanging="GridView2_PageIndexChanging">
and then try your code
Iftikar HussainPosted Jul 23, 2013, 6:57 AM
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
Divin MfwambaPosted Jul 23, 2013, 6:52 AM
Sanjeeb LenkaPosted Jul 23, 2013, 6:26 AM
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;
Pankaj PandeyPosted Jul 23, 2013, 6:15 AM
select gridview+go to property window+Change Allow paging from false to true.
and then try, hope it will work.
Iftikar HussainPosted Jul 23, 2013, 5:36 AM
You need to set like this
Regards,
Iftikar