Group List View Data(组列表查看数据)
This lesson explains how to group the Employee List View data by department and position.
本课介绍如何按部门和职位对员工列表视图数据进行分组。
Note
Before you proceed, take a moment to review the previous lessons: 在继续之前,请花点时间回顾一下之前的课程:
- Place an Action in a Different Location(将操作放在不同的位置)
Step-by-Step Instructions(分步说明)
1.Open the Model.DesignedDiffs.xafml file in the Model Editor.
在模型编辑器中打开Model. DesignedDiffs.xafml文件。
2.Click the Views | MySolution.Module.BusinessObjects | Employee | Employee_ListView | Columns node to open the Grid List Editor Designer. Right-click the table header and select the Show Group By Box item.
单击Views|MySolutions. Module.BusinessObjects|Employee|Employee_ListView|列节点以打开网格列表编辑器设计器。右键单击表格标题并选择按框显示分组项。
3.The Group Panel appears above the column headers.
组面板出现在列标题上方。
4.Drag the Department and Position column headers to the Group Panel. Note that multiple columns in the group area create nested groups.
将部门和位置列标题拖到组面板。请注意,组区域中的多个列创建嵌套组。
When you add a column to the Group Panel, the column’s GroupIndex property value changes. You can also directly specify a column’s GroupIndex property to group List View data. See the following topic for more information: List View Columns Customization.
将列添加到组面板时,列的GroupIndex属性值会更改。您还可以直接指定列的GroupIndex属性来对列表视图数据进行分组。有关详细信息,请参阅以下主题:列表视图列自定义。
5.Run the application. The Employee List View displays objects grouped by the Department and Position properties. You can see the Group Panel above the grid:
运行该应用程序。员工列表视图会按照部门和职位属性对对象进行分组显示。您可以在网格上方看到分组面板:
ASP.NET Core Blazor
Windows Forms
Note
Users can drag columns to and from the Group Panel to group and ungroup the List View objects. You can hide the Group Panel to prevent users from changing groups. Navigate to the Views | MySolution.Module.BusinessObjects | Employee | Employee_ListView node and set its IsGroupPanelVisible property to False.
用户可以在组面板中拖动列来对列表视图对象进行分组和取消分组。您可以隐藏组面板以防止用户更改组。导航到Views | MySolution.Module.BusinessObjects | Employee | Employee_ListView节点,并将其IsGroupPanelVisible属性设置为False。
Next Lesson(下一课)
Enable Split Layout in a List View
在列表视图中启用拆分布局