简体   繁体   English

具有不同单元格类型(如属性网格)的DataGridView

[英]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.

相关问题 将不同的 DataGridView 单元格类型添加到列 - Adding Different DataGridView Cell Types to a Column 根据填充的数据在DataGridView中具有不同的单元格类型(文本框,下拉列表,复选框,单选按钮) - having different cell types (textboxes, dropdownlists, checkboxes, radiobuttons) in a DataGridView according to data filled 如何在DataGridView单元格中放置数字网格 - How to put a digit grid in a DataGridView cell 是否有一个免费的wpf网格,其行为类似于winforms中的DataGridView等普通网格? - Is there a free wpf grid that behaves like normal grid like the DataGridView in winforms? 将列设置为DataGridView中的其他属性 - Set column to different property in DataGridView 在属性网格中编辑自定义类型 - Editing custom types in property grid 与文本框相关的问题:就像是DatagridView单元一样进行验证 - Textbox related Question: Validating Like it was a DatagridView Cell 根据DataGridView的DataSource中的属性更改DataGridView的单元格图像 - Change DataGridView's cell image based on a property in DataGridView's DataSource 在Winforms DataGridView中用不同类型的单元格填充列 - Populate column with different types of cells in winforms DataGridView DataGridView同一列中的不同单元格格式可能吗? - DataGridView Different cell formatting in same column possible?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM