Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am trying to Create two groups In Data Grid like this example http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm but there are an error and I don't know what is the reason or how to solve it enter image description here

like image 909
feby Avatar asked Mar 17 '15 06:03

feby


1 Answers

Sorting event seems not handled properly here. You can handle it in following manner

<asp:GridView ID="GridView1" runat="server" AllowSorting="true" 
  OnSorting="GridView1_Sorting"> 
</asp:GridView>
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{ 
    dataTable.DefaultView.Sort = e.SortExpression ;
    GridView1.DataSource = dataTable;
    GridView1.DataBind();
}
like image 168
amit dukane Avatar answered Sep 21 '22 21:09

amit dukane