0

I Have a GridView control. In That I have a 1 template field with 2 buttons ( Previous, Next ). When ever if i click those buttons i dont want to bind the dataset data to GridView. If i press paging numbers i want to bind data to GridView.

Any Help ?

0

1 Answer 1

3

You can use GridView PageIndexChanging event and bind your dataset:

In GridView aspx, register like this:

 OnPageIndexChanging="gridView_PageIndexChanging"

In your code-behind (C# code):

protected void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
   gridView.PageIndex = e.NewPageIndex;
   gridView.DataSource = /* Specify your dataset you want to bind here */
   gridView.DataBind();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.