DataGrid的数据源本来就是dataview上绑定的,何来的对应不对应啊?查询可以用dataview的sortfilter

解决方案 »

  1.   

    我指的是排序后,DataGrid的行不能对应数据源表的行呀
      

  2.   

    控件绑定的其实是数据表的视图dataview
      

  3.   

    和datatable不对应,和dataview可以对应。
      

  4.   

    每个表有关键字ID,在grid中设置DataKeyField,通过(int)dg.DataKeys[dg.SelectedIndex]与表对应。
      

  5.   

    将DataTable对应的DataView邦定到DataGrid上
    DataTable tb;
    ...
    DataView view;
    view = new DataView(tb)
    ...
    DataGrid grd = new ....
    grd.DataSource = view
    访问的时后
    view [grd.CurrentRowIndex].Row就是相应的行
      

  6.   

    同DataSet应该是不是能对应起来的
    我也想知道这个问题