在c#或VB.NET中更改dataGridView中某些行的颜色 [英] change color of some Rows in a dataGridView in c# or VB.NET

查看:422
本文介绍了在c#或VB.NET中更改dataGridView中某些行的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含2列Student_Name的数据库。和等级

所有数据行必须在dataGridView中显示。

i想要将行的颜色更改为红色,以便Student_Name等级小于10
并将Student_Name的行颜色更改为蓝色,其中等级介于11和15之间
并将行的颜色更改为绿色为Student_Name,等级大于16

解决方案

从中适应:

根据列值更改单个DataGridView行颜色 [ ^ ]


检查以下答案

根据条件更改datagridview单元格颜色 [ ^ ]

I have a database which has 2 columns "Student_Name" and "grade"
all rows of db must be shown in dataGridView.
i wants to change color of rows to red for Student_Name which grade is less than 10
and change color of rows to blue for Student_Name which grade is between than 11 and 15
and change color of rows to green for Student_Name which grade is more than 16

解决方案

adapt from this:
Change individual DataGridView row colors based on column value[^]


check below answer
Changing datagridview cell color based on condition[^]


这篇关于在c#或VB.NET中更改dataGridView中某些行的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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