如何判断dataGrid当前选中的是哪行?

解决方案 »

  1.   

    DataGrid 的CurrentRowIndex属性,获取当前选定的行!
      

  2.   

    有了这个你什么问题都解决了http://blog.csdn.net/latitude/archive/2003/01/02/17220.aspx
      

  3.   

    CurrentRowIndex.当前行的索引.选中某行可以用:
    dataGrid1.Select(dataGrid1.CurrentRowIndex);
      

  4.   

    dgMain.CurrentCell.RowNumber取出当前行对应的DataTable的值。
    如下:
    DataRowView drv = (DataRowView)this.BindingContext[this.ds,this.ds.Tables[0].TableName].Current;
    获取到drv就可以改数据,还可以获取
    DataRow drow = drv.Row; http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp