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 ...
随机推荐
- UNIX基础--Shells
Shells Shell提供了一个和操作系统交互的命令行接口.shell的主要功能就是从输入取得命令然后去执行.FreeBSD内含了一些shell,包括:Bourne shell(sh). exten ...
- Dev的GridControl控件选择框的使用
先介绍环境:VS2010,dev11.2 想要达到的效果:,当单击某一行时前面的选择框选中. 在网上找了不少,但是感觉跟我想的做法很不一样(有很多都是再另外添加一个什么CheckBox,这个我在Dev ...
- [转]Jmeter(一)-精简测试脚本
通过jmeter代理录制脚本后,会产生大量的无用的请求,尽管在代理中已经过滤了一部分图片或者CSS.JS文件. 手动查看主要的请求:这里主要关注登陆请求,要确定有效的URL请求 删除除/Login.a ...
- PHP 苹果消息推送
/* * 苹果消息推送方法 * $deviceToken 苹果设备token * $message 消息内容 */ function iosmsg_send($deviceToken,$message ...
- Windows Server2012上使用Nginx做文件服务器
由于项目中用到了大量的文件上传和删除,考虑到安全的因素,所以整体的思路是使用FTP从主服务器把文件资源上传到文件服务器上. FTP上传到服务器的代码如下(简单附加一下,具体的网上很多) public ...
- redis - 主从复制与主从切换
redis2.8之前本身是不支持分布式管理的,一般建议使用redis3.0及以后版本 redis主从切换的方法 keepalive 或者 使用sentinel线程管理 说明如何使用sentinel实 ...
- 实战荟萃-UI篇
一. 前言 平时在处理问题的时候,经常会遇到一些奇奇怪怪的问题,今天在这里将其记录下来.这里将会列举几个常用的UI问题进行讲解 二. 导航栏 iOS导航栏绝对是个巨坑.和很多朋友聊天都是自己实现了一套 ...
- 转: Executor类
Executor框架是指java 5中引入的一系列并发库中与executor相关的一些功能类,其中包括线程池,Executor,Executors,ExecutorService,Completion ...
- 五、oracle基本建表语句
--创建用户create user han identified by han default tablespaceusers Temporary TABLESPACE Temp;grant conn ...
- 自定义控件学习之canvas和paint相关知识点学习
1,继承自view,实现ondraw方法: 初始化画笔,TextPaint paint,并设置画笔属性: paint.setFlags(Paint.ANTI_ALIAS_FLAG):画笔抗锯齿. pa ...