关于DataGridViewCombobox列ITEMS C#中的颜色更改 [英] Regarding Color Change in DataGridViewCombobox Column ITEMS C#

查看:88
本文介绍了关于DataGridViewCombobox列ITEMS C#中的颜色更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我正在应用程序中使用DataGridView控件.
在该DataGridView中,一列是dataGridViewCombobox列.

每个组合框中有4个项目.

我需要做的是对于每个项目,其Bcak颜色应有所不同.
我想得到一个这样的事件,
在组合框拖放"上,这些项目应以适当的背面和颜色"显示.
DatagridView事件中是否存在任何此类事件??

我该如何实施.

预先感谢您

问候
Lakshman

Hello,


I am using DataGridView Control in an Application.
In that DataGridView, One Column is dataGridViewCombobox Column.

In each Combobox, there are 4 Items.

What I need to do is For Each Item, its Bcak Color Should Be Different.
I want to get an event such that,
On Combobox Drop, these items should be visible with their appropriate back and For Colors.
Is there any Such Event in DatagridView Events.?

How Can i implement this.

Thank you in Advance

Regards
Lakshman

推荐答案

您不能使用标准的DataGridViewComboBoxColumn来完成此操作.您必须创建自己的自定义ownerComboBox,然后将其包装在自己的自定义DataGridViewColumn中,并从该类继承.

您可以找到此类
You cannot do it using the standard DataGridViewComboBoxColumn. You have to create your own custom ownern ComboBox, then wrap that in your own custom DataGridViewColumn, inheriting from that class.

You can find examples of such here[^].


这篇关于关于DataGridViewCombobox列ITEMS C#中的颜色更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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