Thursday, March 22, 2012

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

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!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)
{
//...
}
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Arjen" <boah123@.hotmail.com> wrote in message
news:ddsgue$nbj$1@.news1.zwoll1.ov.home.nl...
> 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!
>
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!
"Teemu Keiski" <joteke@.aspalliance.com> schreef in bericht
news:epu6hdooFHA.1372@.TK2MSFTNGP10.phx.gbl...
> 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)
> {
> //...
> }
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
> "Arjen" <boah123@.hotmail.com> wrote in message
> news:ddsgue$nbj$1@.news1.zwoll1.ov.home.nl...
>

1 comments:

Unknown said...

Hello,

In the nicest possible way I had to remove your horrible background image as it was very distracting and reading the text wasn't easy!

Ta.

Post a Comment