Sunday, March 11, 2012

Problem on gridview paging

hi,

it seems you bind the data yourself and you don't use data source, right ?

If that's the case you need to add a few more line to get the paging working:

1) add an event handler for the page index changing event (in the page load event)

this.gvIncoming.PageIndexChanging += new GridViewPageEventHandler(gvIncoming_PageIndexChanging);

2) add the function:

void gvIncoming_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.gvIncoming..PageIndex = e.NewPageIndex;
// here bind the data again
this.gvIncoming.DataSoruce = your data source here;
this.gvIncoming.DataBind();
}

The same for the second grid view as well.

Cheers,

Yani

No comments:

Post a Comment