将datable绑定到datagrid问题 [英] bind datable to datagrid Question probllem
问题描述
也许这是一个奇怪的问题 跨度>
我有两个表格 1个数据网格视图和 1个数据表
i have two tables 1 datagridview and 1 datatable
datagridview 是| """"""""""""""""""""""" | 克利夫顿" | 兰迪" | " merlyn"
the columns in datagridview are | "datum" | "clifton" | "Randy" | "merlyn"
数据中的第一个单元格值是   ; | 2010年12月28日8:00 |空|空的 |空
the first cell value in datum is | 28-12-2010 8:00 |empty | empty | empty
数据中的第二个单元格值是 | 2010年12月28日8:30 |空 |空 |空
--------------- -----------------------------------
数据表,我有列| nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; |治疗" | 名称"
in the datatable i have columns | "datum" | "treatments" | "names"
,并且单元格中的值是 | 28-12-2010 8:00 | "剪切" |" clifton
and the values in the cells are |28-12-2010 8:00 | " CUTTING" |"clifton
> ; nbsp; b ; | 2010年12月28日 8:30 | " BLOWDRY" ||"Randy"
|28-12-2010 8:30 | " BLOWDRY"|"Randy"
所以我的问题是
如何使用从加载 数据表价值基准并将值从列处理命名为 datagridview
how can i load from datatable corresponding on value datum and names the value from column treatments in to the datagridview
那是问题 请帮助
thats the Question please help
推荐答案
然后将autogeneratecolumns设置为false并自己进行设置(使用设计者或使用代码)
Then set the autogeneratecolumns to false and do the setting of that yourself (with the designer or in code)
http://msdn.microsoft.com/en -us/library/system.windows.forms.datagridview.autogeneratecolumns.aspx
请注意,datagridview不是表,它是显示表的控件.
Be aware a datagridview is not a table, it is a control which shows tables.
这篇关于将datable绑定到datagrid问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!