我如何比较网格视图的值(更高或更低的范围) [英] how can i compare values of grid view itams(with rang higher or lower)

查看:86
本文介绍了我如何比较网格视图的值(更高或更低的范围)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#开发病理管理系统。由于singel网格单元的更高范围和低范围值,我需要用于更改零售字体颜色的代码。

解决方案

在网格行数据绑定事件中,您可以检查值和更改单元格值的颜色使用下面的代码

int columnIndex = 1;

int rowIndex = 2;

//创建基于粗体的字体在默认字体上

字体newFont = new Font(dataGridView1.Font,FontStyle.Bold);

dataGridView1 [columnIndex,rowIndex] .Style.Font = newFont;

i am developing a pathology management system in C# . i need code for change the color of font retailed to result due to higher range and low rang value of singel grid cell.

解决方案

In grid row databound event you can check values & change color for cell values using below code
int columnIndex = 1;
int rowIndex = 2;
// create bold font based on the default font
Font newFont = new Font(dataGridView1.Font, FontStyle.Bold);
dataGridView1[columnIndex, rowIndex].Style.Font = newFont;


这篇关于我如何比较网格视图的值(更高或更低的范围)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆