我正在尝试创建一个数据网格视图,它将自动格式化用户输入的数字。我的 datagridview 没有链接到数据源,它是以编程方式构建的,如下所示:
Private Sub FormatGridView()
Dim ILNumColumn As New DataGridViewTextBoxColumn
Dim ArtNumColumn As New DataGridViewTextBoxColumn
Dim DescColumn As New DataGridViewTextBoxColumn
'Header text
ILNumColumn.HeaderText = "# IL"
ArtNumColumn.HeaderText = "# Articles"
DescColumn.HeaderText = "Description"
'Wrap
DescColumn.DefaultCellStyle.WrapMode = DataGridViewTriState.True
'Widths
ILNumColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
ArtNumColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
DescColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
'Add columns
dgvArticles.Columns.Add(ILNumColumn)
dgvArticles.Columns.Add(ArtNumColumn)
dgvArticles.Columns.Add(DescColumn)
End Sub
有没有办法让IlNumColumn
总是在绿色圆圈下面的格式?