以下内容为学习 DevExpress 过程中的以下总结: 1、Grid 根据单元格设置行背景色: private void gvTaskOrderDetail_RowCellStyle(object sender, RowCellStyleEventArgs e) { GridView gv = sender as GridView; Int32? goodsStockQty = CommonUtils.ObjectToInt32( gv.GetRowCellValue(e.RowHandle, gv.Columns.ColumnByFieldName("GOODSSTOCKQTY"))); Int32? productId = CommonUtils.ObjectToInt32( gv.GetRowCellValue(e.RowHandle, gv.Columns.ColumnByFieldName("TASKPRODUCTID"))); if (goodsStockQty != null) { if (goodsStockQty > 0) { e.Appearance.BackColor = Color.Pink; } else { if (productId == Constants.SMJH_ID) { e.Appearance.BackColor = Color.Pink; } } } else { if (productId == Constants.SMJH_ID) { e.Appearance.BackColor = Color.Pink; } } } 2、c#程序查询 oracle,在界面数据显示“?”,解决方法: 在客户的电脑新建环境变量,变量名为:NLS_LANG 值为:SIMPLIFIED CHINESE_CHINA.ZHS16GBK 3、数字控件去掉上下滚动箭头: 属性: AllowMouseWheel:false 4、CheckedComboBox Edit 下拉多选控件的使用: a、初始化: foreach (DataRow dr in dt.Rows) { this.chkcbGoodsType.Properties.Items.Add(new ComboxInfo(dr["GOODSTYPEID"].ToString(), dr["GOODSTYPENAME"].ToString())); } 第二种方法: CheckedListBoxItem[] itemListQuery = new CheckedListBoxItem[listCustomerType.Count]; int check = 0; foreach (DictDetailVo det in listCustomerType) { itemListQuery[check] = new CheckedListBoxItem(det.DictDetailCode, det.DictDetailName); check++; } this.chkcbCustomerType.Properties.Items.AddRange(itemListQuery); b、后台赋值:(id 和 name 对应) 第一种方法:this.chkcbGoodsType.EditValue = dt.Rows[0]["GOODSTYPEID"].ToString(); this.chkDriveTruckType.RefreshEditValue(); 或者 this.chkcbGoodsType.Text = dt.Rows[0]["GOODSTYPENAME"].ToString(); 第二种方法this.chkcbGoodsType.EditValue =new CheckedListBoxItem( dt.Rows[0]["GOODSTYPEID"].ToString(),dt.Rows[0]["GOODSTYPENAME"].ToString()); c、获取选中的值: IList< ob...