不太懂你的意思
选的行
private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) 
 { 
      System.Drawing.Point pt = new Point(e.X, e.Y); 
      DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt); 
      if(hti.Type == DataGrid.HitTestType.Cell) 
      { 
           dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column); 
           dataGrid1.Select(hti.Row); 
      } 
 }

解决方案 »

  1.   

    不是鼠标事件,是在一个按钮事件里想知道DataGrid当前选择的那一行,以前用DataTable做数据源时可以用CurrentRowIndex(刚才搞错了)属性,但是现在用DataView作数据源,不管选了哪一行,CurrentRowIndex都是0,CurrentCell.RowNumber也是0
      

  2.   

    可以设置一个全局变量,再在DataGrid的Click、CurrentCellChanged事件中获取CurrentRowIndex并赋值给该全局变量,这样不就可以了吗。^_^
      

  3.   

    (System.Data.DataRowView)(this.BindingContext[dataGrid1.DataSource]).Current.Row
      

  4.   

    DataTable 中的某一行不一定在DataGrid中,而DataView的行一定在DataGrid中,所以这个属性对DataView是没有意义.