使用DataGridView制作水平表的问题 [英] Problem with making a horizontal table using DataGridView

查看:94
本文介绍了使用DataGridView制作水平表的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用DataGridView控件创建一个水平表.问题在于DataGridView接口是用于垂直接口的(即行代表单个对象,对象的列属性),而尝试创建水平接口有很多陷阱:

*只能访问单个单元格从DataGridView :: Rows,而不是DataGridView :: Columns.在向表中添加新条目时,我需要访问表的所有行以将值添加到单列中.
*将DataGridView :: ColumnCount设置为零会破坏表的所有行. (将DataGridView :: RowCount设置为零不会破坏列.)我知道的唯一解决方法是将ColumnCount设置为1,并使第一列不可见.
* DataGridView :: Sort方法仅允许您对表进行排序

除了更改应用程序用户界面的布局以使表垂直之外,是否对我有帮助?

I am trying to create a horizontal table using the DataGridView control. The trouble is that the DataGridView interface was made for vertical ones (i.e. rows represent individual objects, columns properties of the objects), and trying to create a horizontal one has numerous pitfalls:

*Individual cells can only be accessed from DataGridView::Rows, rather than DataGridView::Columns. When adding a new entry to the table, I need to access all rows of the table to add values to the single column.
*Setting DataGridView::ColumnCount to zero destroys all the rows of the table. (Setting DataGridView::RowCount to zero does NOT destroy columns.) The only workaround I am aware of is to set ColumnCount to 1 and make the first column invisible.
*The DataGridView::Sort method only allows you to sort table rows by values in a particular column, not vice versa.

Is there any help to me, apart from changing the layout of my application's user interface to make the table vertical?

推荐答案

Hello Mike, 

谢谢为您的帖子!不幸的是,我无法确定哪个论坛或新闻组最适合您的问题.您能否向我提供有关您所询问的产品或技术的更多详细信息?

谢谢!


这篇关于使用DataGridView制作水平表的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆