Click here to Skip to main content
15,921,774 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
while clicking on header of shorting the error came of - The GridView 'GridView1' fired event Sorting which wasn't handled.

XML
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
                                AllowSorting="True" SupportsCallback="True"  AutoGenerateColumns="False" AutoGenerateSelectButton="True"
                                EnableModelValidation="True" Height="124px"
                                onpageindexchanging="GridView1_PageIndexChanging" Width="1069px">
                                <Columns>
                                    <asp:BoundField DataField="AccountNo" HeaderText="Account No" SortExpression="AccountNo">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="DepositType" HeaderText="Deposit Type" SortExpression="DepositType">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="AccountType" HeaderText="Account Type" SortExpression="AccountType">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="InterestRate" HeaderText="Interest Rate" SortExpression="InterestRate">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="OpenedDate" HeaderText="A/C Opened Date" SortExpression="OpenedDate">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="MaturityDate" HeaderText="Maturity Date" SortExpression="MaturityDate">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status">
                                    <HeaderStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                </Columns>
                            </asp:GridView>
Posted
Comments
Tom Marvolo Riddle 31-Oct-13 3:56am    
Use sorting event in gridview.Get it in gridview property

1 solution

place this
onsorting="GridView1_Sorting"
in source
Add this event in CS:
C#
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
  {

  }

For further reference refer here:
Sorting in Gridview Asp.net C#[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900