这应该在从数据库中获取数据时排序,要排序的字段就是你在DataGrid中用的那个。--------------------------------
AspNetPager 免费分页控件4.0版发布,欢迎下载使用:http://www.webdiyer.com

解决方案 »

  1.   

    响应Sort和Page事件参考DataGrid帮助吧ms-help://MS.VSCC/MS.MSDNVS.2052/Vbcon/html/vbtskAddingSortingToDataGridWebControl.htmms-help://MS.VSCC/MS.MSDNVS.2052/Vbcon/html/vbtskSpecifyingPagingBehaviorInDataGridWebControl.htm
      

  2.   

    private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
    {
    DataGrid1.CurrentPageIndex=e.NewPageIndex;
    BindData();
    }DataGrid的属性
    AllowPaging="True" PageSize="5" AllowSorting="True"
      

  3.   

    http://lucky_elove.www1.dotnetplayground.com/