各种属性介绍连接汇总

GridView: 
http://blog.csdn.net/21aspnet/article/details/1540301

 

排序:

            DataView dv = dt.DefaultView;
            string sort =(string)ViewState["SortExp"] + " " + (string)ViewState["SortDerect"];
            dv.Sort = sort;

            GvCourses.DataSource = dv;
            GvCourses.DataBind();

其中,  ViewState["SortExp"] = "ID" 为绑定的字段名称;  ViewState["SortDerect"] = "ASC"; 控制升序还是降序;降序为“DESC“; 两者的顺序不能颠倒,否则找不到对应的列,报”Can't find the column"的错误;

  

 

posted @ 2012-05-27 14:17  Crazylight  阅读(159)  评论(0编辑  收藏  举报