The GridView 'GridView1' fired event Sorting which wasn't handled

A

Arjen

Hi,

I get this error message when sorting a gridview:
The GridView 'GridView1' fired event Sorting which wasn't handled

What do I need to do?

Thanks!
 
T

Teemu Keiski

Hi,

you have AllowSorting="true" set for the GridView and therefore you need to
have event handler for its Sorting event

<asp:GridView AllowSorting=true ID="GridView1" runat="server"
OnSorting="GridView1_Sorting">
...
</asp:GridView>


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

Arjen

I tried, I don't get it to work.
I don't know what to add inside the GridView1_Sorting method.

I'm using the gridview with templatefields.

Can you help me?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top