[英]DataGridView with different cell types like the Property Grid
Is it possible to configure the DataGridView in .NET to behave like the Property Grid? 是否可以将.NET中的DataGridView配置为类似于属性网格? I mean to display different styles of cells per row?
我的意思是每行显示不同样式的单元格? All I can do so far is to change the type per column.
到目前为止,我所能做的就是更改每列的类型。
I do have a list of Parameter Objects, some of them are single numeric values and some are arrays. 我确实有一个参数对象列表,其中一些是单个数值,有些是数组。 So I would like to display all them in a DataGridView.
所以我想将所有这些显示在DataGridView中。 The scalar values should be editable in the list, but for arrays I would like to display a link "Edit" in the same cell.
标量值应在列表中可编辑,但对于数组,我想在同一单元格中显示链接“ Edit”。
if you want to add comboBox columns dynamically to your datagridview you could use the following code: 如果要将动态的comboBox列添加到datagridview中,则可以使用以下代码:
Dim GridOptions() As String = {"Test1", "Test2", "Test3"}
Dim DropDownCol As New DataGridViewComboBoxColumn
DropDownCol.DataSource = GridOptions
DataGridView1.Columns.Add(DropDownCol)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.