使用DataView.Find 方法,具体请你查帮助!

解决方案 »

  1.   

    dataKey是什么?请大侠讲清楚点。谢谢!!!
      

  2.   

    这个问题经常有人问啊,得用下面得方法:System.Windows.Forms.BindingManagerBase dsMgr = this.BindingContext[ds1.Tables[0]]; 
    在排序后要得到当前的DataRow就得用:
    DataRow dr = ((DataRowView)dsMgr.Current).Row; 
    string infoID = dr["InfoID"].ToString(); 
    不能使用dsMgr.position来得到,这点需要注意。
      

  3.   

    但是我想得到排序后,其对应的ds1的position,应该怎么做?请指教。
      

  4.   


    在该行的点击事件中取该行的主键值。
    好象是e.cells.findkey什么的,我用过的,现在没环境给你试,等回去试一下再告诉你。
      

  5.   

    一般我觉得这样取是最合理的,不同的排序的没有问题
    DataRow dr = ((DataRowView)this.BindingContext[ds1.Tables[0]].Current).Row;