DataGridView中CellFormatting事件的应用
来源:互联网 发布:linux 8080端口被占用 编辑:程序博客网 时间:2024/06/16 20:27
首先来看一下CellFormatting事件在vs中的解释:
需要设置单元格内容的显示格式时发生
举例说明:
这里是根据条件判断下一型号所在列的背景色改变:
private void dgvMouldTypeing_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.RowIndex != -1 && dgvMouldTypeing.Columns[e.ColumnIndex].Name == "Model") { string stateName = dgvMouldTypeing.Rows[e.RowIndex].Cells["StateName"].Value.ToString();//查询条件 if (stateName == "未保养") { e.CellStyle.BackColor = Color.Red; } if (stateName == "已保养") { e.CellStyle.BackColor = Color.Green; } if (stateName == "保养中") { e.CellStyle.BackColor = Color.Yellow; } } }
0 0
- DataGridView中CellFormatting事件的应用
- DataGridView的事件CellForMatting的定位
- DataGridView CellForMatting事件 相当于GridView的RowBound
- DataGridView的CellFormatting事件绑定判断
- DataGridView.CellFormatting 事件
- 利用DataGridView 的 RowPostPaint 事件 和 CellFormatting 事件 对行划线
- DataGridView中DataGridViewComboBoxColumn的一些相关应用(一)让其值改变时触发事件
- DataGridView中ComboBox列的触发事件
- c#中datagridview的EditingControlShowing事件
- DataGridView中comboBox(DataGridViewComboBoxColumn)的事件编写
- Winform中DataGridView的复选框事件
- C#中,模拟DataGridView的CellClick事件
- DataGridView中comboBox(DataGridViewComboBoxColumn)的事件编写
- C#中,模拟DataGridView的CellClick事件
- C++.NET中DataGridView的主要应用
- DataGridView的回车事件
- WinForm中DataGridView的 CellClick 事件的代码
- DataGridView 中Combobox 重载事件
- Ehcache——设置缓存的大小
- IOI集训论文集
- POJ 3020 Antenna Placement
- Xcode 7 设置 LaunchImage图片
- AFNetworking3.0学习笔记[更新中]
- DataGridView中CellFormatting事件的应用
- 做UE的软件
- 根据Matrix获取Rotation
- 几种常见的博弈
- 前端冷知识
- OpenCV+ Python
- DP之最长不降子序列类问题
- 导出Excel方式汇总-- 第一种
- HDOJ-----1559最大子矩阵