WinForms datagrid 反转,以便列 headers 成为(重复)行标签

WinForms datagrid inverted so that column headers become (repeating) row labels

我希望在 data-aware WinForms 网格控件中显示多条记录,这样 column-headers 变成(重复)row-labels。各大third-party WinForms控件厂商的grid有没有这个功能,或者built-in grid控件可以做到吗?或者有没有办法在提供重复垂直组的控件中使用标签、文本框和日期选择器来模拟它?

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

Is there a way to simulate it using labels and textboxes and datepickers in a control that offers repeating vertical groups?

您可以使用以下任一选项:

  • DataReapter
    您可以使用 DataRepeater 控件。

    The Visual Basic Power Packs DataRepeater control is a scrollable container for controls that display repeated data, for example, rows in a database table. It can be used as an alternative to the DataGridView control when you need more control over the layout of the data. The DataRepeater "repeats" a group of related controls by creating multiple instances in a scrolling view. This enables users to view several records at the same time.

  • TableLayoutPanel 或 FlowLayoutPanel 中显示的自定义用户控件
    您可以创建自定义 UserControl 以这种方式显示记录,然后使用 TableLayoutPanelFlowLayoutPanel 显示所有记录。

  • 自定义 DataGridViewColumn
    您可以创建一个自定义 DataGridViewColumn 托管一个复杂的(用户控件),它以这种方式显示行后面的整个对象。