gridControl 中CellValueChanged,ShowingEditor,CustomDrawCell的用法
private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
int hand = e.RowHandle;
if (hand >= 0)
{
if (e.Column.FieldName == "OneV")
{
string obj =gridView1.GetRowCellValue(hand, "Obj").ToString();
if (obj == "高压" || obj == "低压")
{
e.Appearance.BackColor = Color.Red;
}
}
}
}
private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
{
if (gridView1.GetDataRow(e.RowHandle) == null)
return;
if (e.Column.FieldName == "未完成数量" || e.Column.FieldName == "入库未完成数量")
{
int WeiWangChengShu = this.gridView1.GetRowCellValue(e.RowHandle, "未完成数量").ToString() == "" ? 0 : int.Parse(this.gridView1.GetRowCellValue(e.RowHandle, "未完成数量").ToString());
int RukuWeiWangChengShu = this.gridView1.GetRowCellValue(e.RowHandle, "入库未完成数量").ToString() == "" ? 0 : int.Parse(this.gridView1.GetRowCellValue(e.RowHandle, "入库未完成数量").ToString());
if (WeiWangChengShu > 0 || RukuWeiWangChengShu > 0)
{
this.gridView1.SetRowCellValue(e.RowHandle, "进度跟进", "未完成");
}
}
}
private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
{
int thisIndex = this.gridView1.FocusedRowHandle;
if (thisIndex < 0)
{
return;
}
string shengChangType = this.gridView1.GetRowCellValue(thisIndex, "生产类型").ToString();
if (shengChangType != "包装")
{
if (this.gridView1.FocusedColumn.FieldName == "未完成数量" || this.gridView1.FocusedColumn.FieldName == "入库未完成数量")
{
e.Cancel = true;
}
}
}
private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
if (this.gridView1.FocusedColumn == e.Column)
{
if (e.Column == this.未完成数量 || e.Column == this.入库未完成数量)
{
//String strUnitNum = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "未完成数量").ToString();
//String strRukuUnitNum = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "入库未完成数量").ToString();//入库未完成数量
int strnum = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "未完成数量").ToString()==""?0:int.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "未完成数量").ToString());
int strRukuNum = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "入库未完成数量").ToString() == "" ? 0 :int.Parse( gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "入库未完成数量").ToString());
//if(int.TryParse(strUnitNum,out strnum))
//{
// if (int.TryParse(strRukuUnitNum,out strRukuNum))
// {
//生产类型=‘包装‘的时候 ;输入的未完成数量/入库未完成数量 不允许大于 任务数;当生产类型<>‘包装’的时候 未完成数量/入库未完成数量 不允许编辑
if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "生产类型").ToString() == "包装")
{
int tasknum = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "任务数").ToString() == "" ? 0 : int.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "任务数").ToString());
if (strnum > tasknum || strRukuNum > tasknum)
{
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "未完成数量", "0");
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "入库未完成数量", "0");
return;
}
}
if (strnum > 0 || strRukuNum>0)
{
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "进度跟进", "未完成");
}
else
{
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "进度跟进", "");
}
// }
//}
}
}
}
gridControl 中CellValueChanged,ShowingEditor,CustomDrawCell的用法的更多相关文章
- Spring mvc中@RequestMapping 6个基本用法
Spring mvc中@RequestMapping 6个基本用法 spring mvc中的@RequestMapping的用法. 1)最基本的,方法级别上应用,例如: Java代码 @Reques ...
- Delphi中stringlist分割字符串的用法
Delphi中stringlist分割字符串的用法 TStrings是一个抽象类,在实际开发中,是除了基本类型外,应用得最多的. 常规的用法大家都知道,现在来讨论它的一些高级的用法. 1.CommaT ...
- Linq中关键字的作用及用法
Linq中关键字的作用及用法 1.All:确定序列中的所有元素是否都满足条件.如果源序列中的每个元素都通过指定谓词中的测试,或者序列为空,则为 true:否则为 false. Demo: 此示例使用 ...
- 标准C++中的string类的用法总结
标准C++中的string类的用法总结 相信使用过MFC编程的朋友对CString这个类的印象应该非常深刻吧?的确,MFC中的CString类使用起来真的非常的方便好用.但是如果离开了MFC框架,还有 ...
- html中的alt和title用法区别
html中的alt和title用法区别 首先明确一下概念,alt是html标签的属性,而title既是html标签,又是html属性.title标签这个不用多说,网页的标题就是写在<title& ...
- HTML中的target(_self,_blank)用法总结
HTML中的target(_self,_blank)用法总结 最近一个项目,多次遇到target='_self', target='_blank'的用法, 再次总结一下: 1.<a>标签 ...
- jquery中append跟prepend的用法
jquery中append和prepend的用法 append 是插入到元素中,并放到元素内的最后面prepend 是插入到元素中,并放到元素内的最前面例$("body"). ...
- js正则表达式中的问号几种用法小结
这篇文章主要介绍了js正则表达式中的问号几种用法,比如+?,*?,{2,3}?可以停止匹配的贪婪模式,感兴趣的朋友可以参考下 在表示重复的字符后面加问号,比如+?,*?,{2,3}?可以停止匹配的贪婪 ...
- SQL Server 中 with tmp 临时表的用法
SQL Server 中 with tmp 临时表的用法 ----------with临时表用法,有时候采用临时表比采用in的效率更高,避免了全表扫描. 实例中实现了查询普通题.大题.子题目的sql ...
随机推荐
- Java笔试题目-my
1.BuildString 和 BefferedString 默认初始容量为 16 , 超出就是 16*2 + 2; 可以看源代码得知; 2.ArrayList 默认的构造方法是一个空的Ob ...
- extjs 6.2 helloworld
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Ecstore安装篇-1.运行系统环境要求
运行系统环境要求 运行系统环境要求 author :James,jimingsong@vip.qq.com since :2015-03-01 支持的操作系统 支持的WEB服务器 支持的浏览器 支持的 ...
- HTML1高级
HTML头部 一.链接在新窗口打开如果要定义整个网页的链接在新窗口打开,只要在/head里定义/base target="_blank"就可以了</p> 二.文档描述1 ...
- MessageBox.Show()时MessageBoxIcon的显示
MessageBox.Show()方法,有个参数是MessageBoxIcon,这个是通过图标来表明提示信息的类型,比如一般.警告.错误等 MessageBoxIcon是一个枚举 所有成员如图: 示例 ...
- 推荐几个好的 Maven 常用仓库网址
注意,以下内容转载自:推荐几个好的 Maven 常用仓库网址 Maven 确确实实是个好东西,用来管理项目显得很方便,但是如果是通过 Maven 来远程下载 JAR 包的话,我宿舍的带宽是4兆的,4个 ...
- drupal7 开发自定义上传、下载模块的上传功能
关键点有两个:1.在页面上显示出上传的控件,2.代码实现文件上传到服务器的功能 一.显示控件: 先来看关键点1: 实现页面显示出上传控件, 关键代码: $form['my_file_field'] = ...
- 寒假学干货之------LinearLayout.layout.weight
所有原始代码由这个大神写的--http://www.cnblogs.com/zhangs1986/archive/2013/01/17/2864237.html layout/activity_mai ...
- python升级2.7.5
一开始有这个需求,是因为用 YaH3C 替代 iNode 进行校园网认证时,一直编译错误,提示找不到 Python 的某个模块,百度了一下,此模块是在 Python2.7 以上才有的,但是系统的自带的 ...
- echarts 折柱混合图 (绑数据后)
html: <div class="flot-chart-content" id="flot-dashboard-chart"></div&g ...