asp.net, gridview, fired event error

The GridView fired event Sorting which wasn't handled.

I got above error message in gridview. No wonder why and how to fix....
CoolDev2014Asked:
Who is Participating?
 
Jitendra PatilConnect With a Mentor Sr.Software EngineerCommented:
i think you are trying to sorting your gridview and you have not handled the sorting event in the code behind as below.

protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
    ...
}

When you are manually doing the data binding, you have to handle all the events around it
For sorting, you should have a handler for GridView's Sorting event.

just check for properties of gridview in visual studio and select the event tab and select sorting, double click in the box and it will be automatically generated in code behind

hope this helps.
0
All Courses

From novice to tech pro — start learning today.