Sunday, August 17, 2008

How to Solve this error "The GridView 'MyGridview' fired event PageIndexChanging which wasn't handled."

You can see this error when you are populating a Gridview with code, and you enabled the Paging Property of the Gridview without implementing the PageIndexChanging Event.

So when you click the next Page in the Gridview you will see this error:

"The GridView 'MyGridview' fired event PageIndexChanging which wasn't handled."

To avoid this issue simply write this code in the PageIndexChanging Event:

MyGridview.PageIndex = e.NewPageIndex;
MyGridview.DataBind();

Hire Me

Follow me on Facebook

Follow me

Do you find this Blog helpful?

Follow by Email

About Me

My Photo
Expert Senior Software Developer

Microsoft Business Card