它的阿伦。这次我在 ASP.Net 中有一个排序问题。对于第一次单击,降序工作正常,但在第二次单击时,不会再次进行升序。它仍然按降序排列。我正在使用 Tableadapter 来显示 gridview 内容。请查看代码并纠正我错过的地方。
protected void gv1_Sorting(object sender, GridViewSortEventArgs e)
{
string sdir = e.SortDirection == SortDirection.Ascending ? "DESC" : "ASC";
DataView dv = new DataView(ds2.AllocationPending(ClientLoggedIn.Text));
dv.Sort = e.SortExpression + " " + sdir;
gv1.DataSource = dv;
gv1.DataBind();
}
另请解释 - 有没有其他方法可以在没有 Dataview 的情况下应用排序。
谢谢你 。