Grid view Page indexing

Posted by Rajasekhar0544 under ASP.NET on 12/28/2012 | Points: 10 | Views : 5380 | Status : [Member] | Replies : 3
Hi,

I have three radio buttons, based on checked property there is dynamic gridview for all of them.
In that i want to implement page indexing.
But the problem is,

private void fillgrid()
{
dsReports.Tables.Add(dtReport);
gvReport.DataSource = dsReports.Tables[0];
gvReport.DataBind();
}

page indexing:
gvReport.PageIndex = e.NewPageIndex;
fillgrid();


on click of page index, the page is refreshing and the data is lost.
Kindly help me.

Thanks&Regards,
Rajsekhar.




Responses

Posted by: Rajesh081725 on: 12/28/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi Raja,
use this link

http://www.dotnetfunda.com/blogs/rajesh081725/3784/gridview-paging-example-in-aspnet-with-numeric-nextprevious-nextpreviousfirstla


Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Rajasekhar0544, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajesh081725 on: 12/31/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi raja,
if the answer is correct

Pls mark as answer

Time is Gold
Thanks & Regards,
Rajesh Kumar,
9962038582.

Rajasekhar0544, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Baimey on: 12/31/2012 [Member] Starter | Points: 25

Up
0
Down
Please try setting the Gridview1_PageIndexChanging as

Gridview1.PageIndex = e.NewPageIndex;
Gridview1.DataSource = dt;
Gridview1.Page.DataBind();


<asp:gridview id="Gridview1" runat="server" autogeneratecolumns="False" allowpaging="True" onpageindexchanging="Gridview1_PageIndexChanging" xmlns:asp="#unknown"></asp:gridview>

Please Mark as Answer If this Helps

Rajasekhar0544, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response