任何想法的问题 [英] any idea for the problem
问题描述
您好
我是Microsoft Visual Studio 2005的新手。我在这里度过了一段艰难的时光。 最初数据看起来在GridView上像这样:
I'm new in Microsoft Visual Studio 2005. I'm having a hard time here. Originally the data looks like this on GridView:
主题       姓名          分数      总计
数学          罗伊                 90           90
数学          杰克               81           81
科学      杰克               87           87
我想要的是这样的:
姓名            主题               总计
              数学      科学      
Roy         90                               90
杰克         81           87             168
有可能吗?
< span style =""> p / s:主题和名称不是硬编码的。
推荐答案
一切皆有可能。取决于你将如何做到这一点。最好的方法是创建一个自定义类,并读取当前的DG,并填写列表< T>其中T是类,然后从列表中重新创建DG。
Everything is possible. Depends on how you are going to do it. Best way would be to create a custom class(es), and read the current DG, and fill the list<T> where T would be the class, and then recreate the DG from the list.
或者通过创建一个dataTable,然后对主题进行一些数学运算来总结它们(就像你一样)使用List< T>)。
Or by creating a dataTable, and then do some math operations over subjects to sum them up (the same you could do with the List<T>).
或者您还有其他方法吗?
Or did you have any other way in mind?
这篇关于任何想法的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!