DataGrid如果绑定到数组?

DataGrid如果绑定到数组
请大家帮忙.
[33 byte] By [lzlvv-天空] at [2008-1-9]
# 1
不太明白
wulu2010 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 2
写错了:
DataGrid如何绑定到数组
lzlvv-天空 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 3
String[] dd=new string[]{"asdf","asdf"};
DataGrid1.DataSource=dd;
DataGrid1.DataBind();
sunjay117-悟空 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 4
DataGrid1.DataBind();
----DataBind()没有这个方法啊
lzlvv-天空 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 5
DataGrid1.DataBind();
----DataBind()没有这个方法啊
=================
一定有

如果不行的话就一个一个赋值把
# 6
楼主是用WinForm.
直接设DataSource就行了
# 7
可能最好用ArrayList
# 8
try..

http://support.microsoft.com/kb/317550/EN-US/
liujia_0421-SnowLover at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 9
大家新年快乐!
看到有这么多人出手相助非常感谢!

我还是没有实现如何将一个数组或者arrarylist的数据源绑定到WinForm的DataGrid.
还请大家帮忙,给出能在WinForm下实现此功能的实例以作参考.
lzlvv-天空 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 10
数组中的成员是什么类型的?

能不能说下具体想实现的效果?
liujia_0421-SnowLover at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 11
databings
hzzz_lgh3399 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 12
DataGridView还是DataGrid?
DataGridView是没有DataBind方法的,如果DataGridView的DataSource设为数组或者List,则每一行显示数组里的一个元素,行里的各个单元格显示元素的各个属性。
danjiewu-阿丹 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 13
liujia_0421(SnowLover) 你好!

实例如下:
string[,] arData = new string[10, 20];
...
窗体上控件datagrid1

问题是:如何将arData 的数据绑定显示在datagrid1控件中?
lzlvv-天空 at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 14
你的意思是10行20列,显示在DataGrid中对吧..

这种情况似乎没有直接的方法来对其进行绑定,建议将字符串数组先存储到一个DataTable中,然后再用DataGrid绑定DataTable就OK了..
liujia_0421-SnowLover at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...
# 15
这种情况似乎没有直接的方法来对其进行绑定,建议将字符串数组先存储到一个DataTable中,然后再用DataGrid绑定DataTable就OK了..
赞成!!
zhangjianli at 2007-10-19 > top of Msdn China Tech,.NET技术,C#...