ongziObj) { FocusedRow_jibengongzi = Convert.ToDecimal(rowJibengongziObj); } } //当数据发生变化时执行 private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e) { int intRowHandle = e.RowHandle; FocusedRow_bumen = Convert.ToString(gridView1.GetRowCellValue(intRowHandle, "bumen")); FocusedRow_xingming = Convert.ToString(gridView1.GetRowCellValue(intRowHandle, "xingming")); //FocusedRow_jibengongzi = Convert.ToDecimal(gridView1.GetRowCellValue(intRowHandle, "jibengongzi")); object rowJibengongziObj = gridView1.GetRowCellValue(intRowHandle, "jibengongzi"); if (DBNull.Value != rowJibengongziObj) { FocusedRow_jibengongzi = Convert.ToDecimal(rowJibengongziObj); } } view plaincopy to clipboardprint?//设置焦点行的焦点单元格的位置 ColumnView view = (ColumnView)gridControl_Gongzi.FocusedView; view.FocusedColumn = view.Columns["bumen"]; //设置焦点行的焦点单元格的位置ColumnView view = (ColumnView)gridControl_Gongzi.FocusedView;view.FocusedColumn = view.Columns["bumen"]; view plaincopy to clipboardprint?//当焦点行发生改变时执行 获取选中焦点行id private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { int intRowHandle = e.FocusedRowHandle; object rowIdObj = gridView1.GetRowCellValue(intRowHandle, "id"); if (DBNull.Value != rowIdObj)//做个判断否则获取不到id后报错 { FocusedRow_id = Convert.ToInt32(rowIdObj); } } //当焦点行发生改变时执行 获取选中焦点行id private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) {