DGV编辑Column属性的窗口Edit Column中有ColumnType这一项,这项默认值是DataGridViewTextBoxColumn。
在生成的DGV中如何改变某一个单元格的这个属性?代码怎么写,点了半天也没点出这个属性来。
例如想改变第一行第二列的这个属性
Me.DataGridView1.Rows(0).Cells(1).后面该怎么写,或者是用其他方法改变
------解决方案--------------------
写在数据绑定之后
Dim cell As New DataGridViewLinkCell
cell.Value = "a12"
DataGridView1.Rows(0).Cells(0) = cell
Dim cell2 As New DataGridViewButtonCell
cell2.Value = "bbb"
DataGridView1.Rows(1).Cells(0) = cell2
Dim cell3 As New DataGridViewCheckBoxCell
cell3.Value = True
DataGridView1.Rows(2).Cells(0) = cell3
Dim cell4 As New DataGridViewImageCell
cell4.Value = My.Resources.excel
DataGridView1.Rows(3).Cells(0) = cell4
------解决方案--------------------
Public Class Form1
'窗体上只需要拉出一个DataGridView,一个Button,其它什么也不用做
'你选中哪个单元格,就可将该单元格设置为ComboBoxCell类型
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load