如何在Gridview中更改每个单元格的样式 [英] how to change style for each cell in Gridview

查看:685
本文介绍了如何在Gridview中更改每个单元格的样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人
我有2个问题契据,每个人都有帮助.
我有一个gridview,当我单击gridview上的一个单元格时,该单元格会将它的样式从文本框更改为组合框或复选框.

第二个问题是在gridview上,我们可以像合并excel一样合并单元格吗?

hi anybody
I have 2 problem deed everybode help.
I have a gridview and when I click on a cell on gridview so This cell will change It''s style from textbox to combobox or checkbox.

second problem is on gridview we can merge the cells the same as excel?
if possible how to do it?

推荐答案

您不能更改单元格控件类型,因为显示的内容由DataGridViewColumn控制.为了做您想做的事情,您必须实现自己的自定义DataGridViewColumn类(不容易!)

DGV还不支持合并单元格.您必须使用支持此功能的第三方网格控件.
You can''t change the cell control type because what is displayed is controled by the DataGridViewColumn. In order to do what you want, you''d have to implement your own custom DataGridViewColumn class (NOT easy!)

The DGV also does not support merging cells. You''d have to use a third party grid control that supports this.


您无法在单元级别上考虑DGV.您不能在单元格级别更改列类型.您必须按列考虑.您只能在列级别更改列类型.我已经告诉过你你该怎么办.
You cannot think about the DGV at the cell level. You cannot change the columntype at the cell level. You must think by columns. You can only make changes to the columntype at the column level. I already told you what you have to do.


这篇关于如何在Gridview中更改每个单元格的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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