use CurrencyManager, for example:CurrencyManager cm;
cm=(CurrencyManager)myGrid.BindingContext[myGrid.DataSource];
DataRowView drv;
drv =(DataRowView) cm.Current;
DataRow myDataRow = drv.Row;

解决方案 »

  1.   

    我用的是VB.Net,这里人多,所以贴过来了……
    有点不太懂……回头研究先……
      

  2.   

    saucer(思归) 果然高手!能解释一下代码的意思吗?为什么要用到CurrencyManager 呢?
    试验成功了,但是看不懂……
      

  3.   

    我问一下,如何能够得到排序以后,这行在dataset中的rownumber
    DataGrid的数据源为 dataset
      

  4.   

    from http://www.c-sharpcorner.com/Database/BasicDbOpsSJ.aspEvery windows form has a BindingContext object. Any datasource that you bind to a windows control to will have an associated CurrencyManager object. The CurrencyManager keeps track of the position and otherwise supervises bindings to that data source. The BindingContext object keeps track of all of the CurrencyManager objects on a form.