GridControl当前行的RowHandle


//得到当前行的RowHandle  
  myDataRow   myDataRow=gridView1.GetDataRow(gridView1.FocusedRowHandle);  
  //去出你想要的字段  
  F_DriverName=myDataRow["DriverName"].ToString();

 

获取GridControl当前选中行的值方法很多。
其中一种在当前行获取焦点时取值。
        private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            string tableKey = this.gridView1.GetRowCellValue(e.FocusedRowHandle, "TableKey").ToString();
            MessageBox.Show(tableKey);
        }
其中TableKey为GridControl列的FieldName属性。
效果图:


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM