Apply Grouping to List View Data 将分组应用于列表视图数据
This lesson will teach you how to apply grouping to List View data. For this purpose, you will group Contact List View data by the Department property.
本课将教您如何将分组应用于列表视图数据。为此,您将按"部门"属性对联系人列表视图数据进行分组。
Note 注意
Before proceeding, take a moment to review the Place an Action in a Different Location lesson.
在继续之前,请花点时间复习"将操作置于不同位置"课程。
- Invoke the Model Editor for the MySolution.Module project. Navigate to the Views | MySolution.Module.BusinessObjects | Contact_ListView | Columns node to invoke the Grid List Editor Designer. It will display the default structure of the List View. You can customize the default appearance of the List View. Invoke the Customization window by right-clicking the table header and selecting Show Group By Box.
-
调用 MySolution.模块项目的模型编辑器。导航到视图 |My解决方案.模块.业务对象 |Contact_ListView |列节点以调用网格列表编辑器设计器。它将显示列表视图的默认结构。您可以自定义列表视图的默认外观。通过右键单击表标题并选择"按框显示组"来调用"自定义"窗口。
- This will set Contact_ListView's IsGroupPanelVisible property to true and display a special group area for Contact List Views in both the WinForms and ASP.NET applications. To specify the column by which the Contact List View will be grouped by default, drag the column's header to the group area. A nested grouping can be applied by dragging multiple columns to the group area. Group the Contact List View against the Department column, then against the Position column.
- 这将Contact_ListView的 IsGroupPanelVisible 属性设置为 true,并在 WinForms 和ASP.NET应用程序中显示联系人列表视图的特殊组区域。要指定默认情况下联系人列表视图的分组列,请将列的标题拖动到组区域。通过将多列拖动到组区域,可以应用嵌套分组。将联系人列表视图分组到"部门"列,然后对"职位"列进行分组。
- Run the WinForms or ASP.NET application and select the Contacts item in the navigation control. The group area is displayed in Contact List View. The column order within this area represents the nesting order of data groups. The Contact List View is grouped by the Department and Position columns.
- 运行 WinForms 或ASP.NET应用程序,并在导航控件中选择"联系人"项。组区域显示在联系人列表视图中。此区域内的列顺序表示数据组的嵌套顺序。联系人列表视图按"部门和职位"列分组。
- You can specify this group area in runtime similarly to described above method. If you want to reset changes clicking Reset View Settings button.
- 您可以在运行时指定此组区域,这与上述方法类似。如果要重置更改,请单击"重置视图设置"按钮。
Note 注意
There is another approach for grouping based on changing the value of GroupIndex property of specific columns (Columns node's child nodes). Refer to the List View Columns Customization article to learn more.
另一种基于更改特定列(列节点的子节点)的 GroupIndex 属性的值进行分组的方法。有关详细信息,请参阅列表视图列自定义一文。
You can see the changes made in this lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/
您可以在本课中为模型调用的模型编辑器中所做的更改。主演示模块项目。主演示应用程序安装在%PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/
.
XAF开发成品案例参考
如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮,您的“推荐”将是我最大的写作动力!欢迎各位转载,但是未经作者本人同意,转载文章之后必须在文章页面明显位置给出作者和原文连接,否则保留追究法律责任的权利。
作者博客: http://www.cnblogs.com/foreachlife
欢迎加入CIIP框架\XAF技术应用交流群: 336090194 群文件中有更多相关工具及文档资料
转载请注明出处。多谢!
欢迎加我微信: admiralcn 或扫码:

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端