DevExpress XtraGrid的使用(AspxGridControl小结) 收藏
自定义焦点行的方法: gridView_bcode.FocusedRowHandle = focuseRowInt; //通过设置GridView 的FocusedRowHandle属性 view plaincopy to clipboardprint?//获取焦点行任意单元格的数据 ColumnView cv = (ColumnView)gridControl_Gongzi.FocusedView;//重新获取此ID 否则无法从表头连删获取不到id int focusedhandle = cv.FocusedRowHandle; object rowIdObj = gridView1.GetRowCellValue(focusedhandle, "id"); if (DBNull.Value != rowIdObj) { FocusedRow_id = Convert.ToInt32(rowIdObj); } //获取焦点行任意单元格的数据 ColumnView cv = (ColumnView)gridControl_Gongzi.FocusedView;//重新获取此ID 否则无法从表头连删获取不到id int focusedhandle = cv.FocusedRowHandle; object rowIdObj = gridView1.GetRowCellValue(focusedhandle, "id"); if (DBNull.Value != rowIdObj) { FocusedRow_id = Convert.ToInt32(rowIdObj); } view plaincopy to clipboardprint?//当数据发生变化时执行 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 != rowJibeng