在DataGrid中,假设有三条数据,如果点击上下箭头,如何自由的将一条数据移到上面或下面呢??或者能不能直接用鼠标拖动DataGrid中的行移到相应的位置呀??

解决方案 »

  1.   

    XP 风格的可拖动列、可排序、可改变宽度的DataGrid的例子 
    http://dev.csdn.net/develop/article/24/24441.shtm
      

  2.   

    我不是要XP的。。我用的就是asp.net自带的DataGrid控件难道没有人知道吗??????
      

  3.   

    DataRow dr=DataSet.Table[0].Rows.Find();
    dr.Delete ();
    DataSet.Table[0].Rows.InsertAt(dr,pos);
    最后重新绑定DataGrid
    试试?
      

  4.   

    table.rows.add("sort")
    for(int i=0;i<table.rows.count;i++)
    table.rows["sort"]=i;
    table.defaultview="sort";大概是这个意思吧,其它的自己写啦
      

  5.   

    如何自由的将一条数据移到上面或下面呢??
    http://singlepine.cnblogs.com/articles/288464.html客户端排序和改变列宽
    http://singlepine.cnblogs.com/articles/284314.html服务器端排序
    http://singlepine.cnblogs.com/articles/266538.html
      

  6.   

    singlepine(小山) :我看了你的代码,我需要服务器端的排序,样式就跟你那里面客户端排序一样。。能够自由排序。。请再帮帮我,好吗?