矩阵中的 Silverlight 数据
有谁知道如何将一些数据排列到数据矩阵中?一个简单的例子:
例如,模型如下:
public class SampleItem
{
public string Category { get; set; }
public int DayOfMonth { get; set; }
public double Value { get; set; }
}
我希望在数据矩阵中显示一个 List
,
DayOfMonth | 1 | 2 | 3 | 4 | ...
---------------------------- ...
Category1 | | 7 | | | ...
Category2 | 2 | | 5 | | ...
Category3 | 1 | 6 | 5 | 1 | ...
因此在行和列的交集中它将显示 Value 的总和其中 DayOfMonth = 列名称,Category = 行名称。
有这个可能吗?也许使用非静态行来表示类别,并有机会在数据网格中启用分组?
Does anyone know how to arrange some data to a data matrix? A simple example:
For example the model would be the following:
public class SampleItem
{
public string Category { get; set; }
public int DayOfMonth { get; set; }
public double Value { get; set; }
}
I would like to have a List<SampleItem>
displayed in data matrix something like
DayOfMonth | 1 | 2 | 3 | 4 | ...
---------------------------- ...
Category1 | | 7 | | | ...
Category2 | 2 | | 5 | | ...
Category3 | 1 | 6 | 5 | 1 | ...
So in the intersection of rows and columns it would display sum of Value where DayOfMonth = Column name and Category = row name.
Is it possible to have this? Maybe with non-static rows for categories and by any chance in a datagrid to enable grouping?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 DataSet 在 Silverlight 中不可用,您可以使用此 DataSet 也许只是该框架中的 DataSet 类型它是针对其他东西的。一旦您拥有类似表格的结构,您就可以简单地遍历数据或轮询数据并根据需要定义总和。
Since DataSet is not available within Silverlight you could use this DataSet perhaps just the DataSet type within that framework as it is geared towards something else. Once you have a table like structure you could simply walk the data or poll the data and define your sums as needed.