将datable绑定到datagrid问题 [英] bind datable to datagrid Question probllem

查看:74
本文介绍了将datable绑定到datagrid问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许这是一个奇怪的问题

我有两个表格 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屋!

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