C#中使用DataGridView显示二维数组中的内容
2013-07-02 22:01
176 查看
http://blog.csdn.net/diyoosjtu/article/details/7555514
code:
code:
int[,] TABLE = new int[,] { { 1, 2, 3 }, { 4, 5, 6 } }; DataTable dt = new DataTable(); for (int i = 0; i < TABLE.GetLength(1); i++) dt.Columns.Add(i.ToString(), typeof(int)); for (int i = 0; i < TABLE.GetLength(0); i++) { DataRow dr = dt.NewRow(); for (int j = 0; j < TABLE.GetLength(1); j++) dr[j] = TABLE[i, j]; dt.Rows.Add(dr); } this.dataGridView1.DataSource = dt;
相关文章推荐
- C#中使用DataGridView显示二维数组中的内容
- C#中datagridview使用tooltip控件显示单元格内容的方法
- C#中使用DataGridView控件显示数组中的内容
- C#中datagridview使用tooltip控件显示单元格内容与datagridview自带的tooltip显示单元格内容的方法
- datagridview使用tooltip控件显示单元格内容
- ACCP学习旅程之-----使用C#开发数据库应用程序(第八章 用DataGridView显示和操作数据库)
- C#判断用户是否使用微信浏览器,并据此来显示真实内容或二维码
- C#如何使用dataGridView控件显示类对象数据
- 使用C#语言,从Excel2007中读取数据,并显示到Form中的DataGridView。
- datagridview使用tooltip控件显示单元格内容
- C#判断用户是否使用微信浏览器,并据此来显示真实内容或二维码
- C#中使用DataGridView控件显示DataTable中的数据
- c#使用itextsharp输出pdf(动态填充表单内容,显示中文)
- c#使用itextsharp输出pdf(动态填充表单内容,显示中文)
- C# datagridview toolTip悬浮框显示详细内容
- c#.winform,datagridview,数组,绑定,字符串,字符串数组绑定datagridview显示,长度,显示数组内容
- C#2005 一个简单的查询界面代码:DataGridView使用、图像显示、复合查询样例
- C#中使用DataGridView按数字大小排序显示access中特定数据
- C#读取Excel表格中内容并显示在DataGridView控件中
- C# WinFrom 中如何将txt内容显示到dataGridView