datagridview中行和列的转换 [英] transformation of rows and columns in a datagridview

查看:121
本文介绍了datagridview中行和列的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在反映数据库的datagridview中转换行和列?
例如:
原始数据库
---------------------------
c 10
h 11
w 12
c 12
h 12
w 12
c 9
h 10
w 20
c 21
h 22
w 23

我想像这样在gridview中显示我的数据库:

在网格中表示数据库:
------------------------------
c h w
-----------------
10 11 12
12 12 12
9 10 20
21 22 23


请给我建议一个解决方案....
谢谢

how to transform rows and columns in a datagridview which reflects the database?
e.g:
original database
---------------------------
c 10
h 11
w 12
c 12
h 12
w 12
c 9
h 10
w 20
c 21
h 22
w 23

i want to show my database in the gridview like this:

representing database in grid:
------------------------------
c h w
-----------------
10 11 12
12 12 12
9 10 20
21 22 23


please suggest me a solution....
thanks

推荐答案

做到这一点的唯一方法是自己创建一个Array并遍历值并构建矩阵,然后将其提供给gridview.
The only way to do this is to create an Array yourself and loop through the values and build the matrix then give it to your gridview.


这篇关于datagridview中行和列的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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