在 WPF 中对分类数据进行分组
这就是我正在尝试做的事情。
动态类别:
- 列可以是 0 个或多个。
- 必须包含 1 个或多个类型列。
- 仅当任何行包含与其关联的类型列数据时才会显示。
数据行:
- 将异步添加。
- 将按Common 进行分组 类别列。
- 如果是,将添加动态类别 尚不存在。
- 如果有的话将添加一个类型列 尚未在其适当范围内存在 动态类别。
平台信息:
- WPF
- .Net 3.5 sp1
- C#
- MVVM
我有一些部分功能原型,但每个原型都有其自己的主要问题。你们中的任何人都可以给我一些指导吗?
想象一下这个漂亮的风格。 :-)
--------------------------------------------------------------------------
|[ Common Category ]|[ Dynamic Category 0 ]|[ Dynamic Category N ]|
--------------------------------------------------------------------------
|[Header 1]|[Header 2]|[ Type 0 ]|[ Type N ]|[ Type 0 ]|[ Type N ]|
--------------------------------------------------------------------------
|[Data 2 Group] |
--------------------------------------------------------------------------
| Data A | Data 2 || Null | Data 1 || Data 0 | Data 1 ||
| Data B | Data 2 || Data 0 | Null || Data 0 | Data 1 ||
--------------------------------------------------------------------------
|[Data 1 Group] |
--------------------------------------------------------------------------
| Data C | Data 1 || Null | Data 1 || Data 0 | Data 1 ||
| Data D | Data 1 || Null | Null || Data 0 | Null ||
--------------------------------------------------------------------------
编辑:排序和分页不是必需的。
我研究了嵌套的 ListViews 和 DataGrids,动态构建网格。动态构建网格并利用 SharedSizeGroup 属性似乎是最有前途的策略,但我担心性能。
更好的方法是将其视为动态报告吗?如果是这样,我应该注意什么?
感谢您的帮助。
Here is what I am trying to do.
Dynamic Category:
- Columns can be 0 or more.
- Must contain 1 or more Type Columns.
- Will only be displayed if any row contains Type Column data associated with it.
Data Rows:
- Will be added Asynchronously.
- Will be grouped by a Common
Category column. - Will add a Dynamic Category if it
does not yet exist. - Will add a Type Column if it does
not yet exist within its appropriate
Dynamic Category.
Platform Info:
- WPF
- .Net 3.5 sp1
- C#
- MVVM
I have a few partially functional prototypes, but each has it's own major set of problems. Can any of you give me some guidance on this?
Envision this nicely styled. :-)
--------------------------------------------------------------------------
|[ Common Category ]|[ Dynamic Category 0 ]|[ Dynamic Category N ]|
--------------------------------------------------------------------------
|[Header 1]|[Header 2]|[ Type 0 ]|[ Type N ]|[ Type 0 ]|[ Type N ]|
--------------------------------------------------------------------------
|[Data 2 Group] |
--------------------------------------------------------------------------
| Data A | Data 2 || Null | Data 1 || Data 0 | Data 1 ||
| Data B | Data 2 || Data 0 | Null || Data 0 | Data 1 ||
--------------------------------------------------------------------------
|[Data 1 Group] |
--------------------------------------------------------------------------
| Data C | Data 1 || Null | Data 1 || Data 0 | Data 1 ||
| Data D | Data 1 || Null | Null || Data 0 | Null ||
--------------------------------------------------------------------------
Edit: Sorting and Paging is not necessary.
I have looked at nested ListViews and DataGrids, dynamically building a Grid. Dynamically building a Grid and leveraging the SharedSizeGroup property seems the most promising strategy, but I am concerned about performance.
Would a better approach be to consider this a dynamic report? If so, what should I be looking at?
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,你需要一个枢轴网格控件。
Infragistics 和 DevExpress
编辑: 但是,如果您手动执行此操作,我会得到类似的内容(从我的头顶开始)
然后我会编写一个如下函数:(伪代码)
我想我留下了可能具有共同类别的几行,但是您会明白的。
它的性能不是最好的,但很容易遵循。
In my opinion you need a pivot grid control.
There are good ones at Infragistics and DevExpress
Edit: but, if you do it manually, I would have something like this (from the top of my head)
Then I would code a function like: (pseudo-code)
I think I left behind the several rows that may have the common category, but you will get the idea.
It's not the best in performance, but it is easy to follow.