gridview排序错误来了 [英] gridview Sorting error came

查看:71
本文介绍了gridview排序错误来了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击短片标题时出现错误 - GridView'GridView1'触发事件排序未处理。



while clicking on header of shorting the error came of - The GridView 'GridView1' fired event Sorting which wasn't handled.

<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>

推荐答案

放置此
onsorting="GridView1_Sorting"

in source

在CS中添加此事件:

in source
Add this event in CS:

protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
  {

  }



如需进一步参考,请参阅:

在Gridview Asp.net C#中排序 [ ^ ]


这篇关于gridview排序错误来了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆