int i=dataGrid .CurrentRowIndex 
Tables.Rows [i]

解决方案 »

  1.   

    楼主看这个是否你需要的
    How can I select the entire row when the user clicks on a cell in the row? 
    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); 
     
         } 
     
    }  
    hope it helps
      

  2.   

    就是通过鼠标在datagrid上选择一行时,要知道在DataTable是对应的是哪一个DataRow,由于没有主键,故不好用dataTable.select查。
    急用。
      

  3.   

    int i=dataGrid .CurrentRowIndex 
    DataView[i]