我想排序功能,也没做过,就这样写了,出现错误,请高手指点一下???
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortDirection == SortDirection.Ascending)
{ 下面这一句提示:未处理的“System.StackOverflowException”类型的异常出现在 System.Web.dll 中。
GridView1.Sort(e.SortExpression, SortDirection.Descending);
GridView1.DataBind();
}
else
{
GridView1.Sort(e.SortExpression, SortDirection.Ascending);
GridView1.DataBind();
}
}
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortDirection == SortDirection.Ascending)
{ 下面这一句提示:未处理的“System.StackOverflowException”类型的异常出现在 System.Web.dll 中。
GridView1.Sort(e.SortExpression, SortDirection.Descending);
GridView1.DataBind();
}
else
{
GridView1.Sort(e.SortExpression, SortDirection.Ascending);
GridView1.DataBind();
}
}
解决方案 »
- 求网站估价和时间
- 如何把数据库(sqlserver)的数据添加到下拉列表(select)
- ASP.NET State Service
- IIS有时出现"您正在查找的页当前不可用",不稳定啊 win2003 sp2系统 .net 2
- 在客户端调用服务器方法和在客户端发送传递参数去服务器 哪个快些?
- 请问如何使自定义服务器空间被IDE只能感知
- 请教:ASP.NET如何实现ISAPI一样的PUSH功能?(本问题500分,说到做到)
- asp.net中如何在/body结束前输入js代码
- asp.net 查询问题
- 请问DataGrid如何能够在某列数据量多时,不换行,也不将列拉长,也就是固定列宽并不换行
- 【JS 正则 字符提取问题】
- CreateUserWizard所使用的数据库能自己配置吗?
DataView dv = ds.Tables[0].DefaultView;
//设置DataView的排序
dv.Sort = e.SortExpression;
//绑定
this.GridView1.DataSource = dv;
this.GridView1.DataBind();