通过CellFormatting事件,可以自定义单元格的表示值。(比如:值为Error的时候,单元格被设定为红色)下面的示例:将“Colmn1”列的值改为大写。[VB.NET]'CellFormatting 事件处理方法Private Sub DataGridView1_CellFormatting(ByVal ...
Windows Forms DataGridView 没有提供合并单元格的功能,要实现合并单元格的功能就要在CellPainting事件中使用Graphics.DrawLine和 Graphics.DrawString 自己来“画”。下面的代码可以对DataGridView第1列内容相同的单元格进行合并:...