第一: 把DATAGRID的属性ALLOWSORTING改为TRUE在PAGELOAD和DataGrid1_SortCommand、SortCommand中加p if(DataGrid1.Attributes["SortDirection"]=="DESC") //这里kjkm_dg为datagrid ID在.Net 中 DataGrid 虽然有排序的功能,但并不支持双向的排序。用到了,看了些相关的帖子,自己尝试了一种方法,竟然也行得通,主要是用DataGrid.Attributes 存了一个参数,同时在onSortCommand中修改了DataGridColumn的SortExpression. 代码如下: private void BindData() 相关文章: