问题描述
我希望在数据感知的WinForms网格控件中显示多个记录,以使列标题成为(重复)行标签.任何主要的第三方WinForms控件供应商的网格都具有此功能,或者可以使用内置的网格控件来完成此功能吗?还是有一种方法可以在提供重复垂直组的控件中使用标签,文本框和日期选择器对其进行仿真?
I'm looking to display multiple records in a data-aware WinForms grid control, such that the column-headers become (repeating) row-labels. Does the grid of any of the major third-party WinForms control vendors have this feature, or can it be done with the built-in grid control? Or is there a way to simulate it using labels and textboxes and datepickers in a control that offers repeating vertical groups?
City xxxxxxxxxxxxxxxxxxxxxx
State xx
Zip xxxxx
Note xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-------
City xxxxxxxxxxxxxxxxxxxxxx
State xx
Zip xxxxx
Note xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-------
City xxxxxxxxxxxxxxxxxxxxxx
State xx
Zip xxxxx
Note xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
推荐答案
您可以使用以下任一选项:
You can use either of these options:
-
DataReapter
您可以使用DataRepeater
控件.
DataReapter
You can use aDataRepeater
control.
TableLayoutPanel或FlowLayoutPanel中显示的自定义UserControl
您可以创建一个自定义UserControl
,它以这种方式显示一条记录,然后使用TableLayoutPanel
或FlowLayoutPanel
显示所有记录.
Custom UserControl shown in TableLayoutPanel or FlowLayoutPanel
You can create a custom UserControl
which shows a record this way and then using a TableLayoutPanel
or FlowLayoutPanel
show all records.
自定义DataGridViewColumn
您可以创建一个自定义DataGridViewColumn
,它托管一个复杂的(用户控件),以这种方式在行后显示整个对象.
Custom DataGridViewColumn
You can create a custom DataGridViewColumn
hosting a complex (user control) which shows the whole object behind the row this way.
这篇关于WinForms datagrid反转,以便列标题成为(重复)行标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!