简体   繁体   English

如何在GridControl中按组数对组进行排序

[英]How to to sort groups by their count in GridControl

While using DevExpress.XtraGrid.GridControl I am trying do the following, When a column is selected and dragged to the upper part of grid (ie grouping by that column) I want the groups to be sorted by their member count. 在使用DevExpress.XtraGrid.GridControl我尝试执行以下操作:当选择一列并拖动到网格的上部(即按该列分组)时,我希望按其成员计数对组进行排序。 I have found no source about how to even begin doing that. 我没有找到有关如何开始这样做的资料。 I am not sure if it is even possible. 我不确定是否有可能。

What I am getting: (Name of Column is Message) 我得到的是:(列名是Message)

Message:(Count=2) X

Message:(Count=7) U

Message:(Count=5) Z

What I want: 我想要的是:

Message:(Count=7) U

Message:(Count=5) Z

Message:(Count=2) X

I think you should handle the StartGrouping event of the grid (more info here ). 我认为您应该处理网格的StartGrouping事件( 此处有更多信息)。 Then I think that it is a matter of sorting the grouped rows manually by setting their indexes giving a row's count. 然后,我认为这是通过设置给定行计数的索引来手动对分组的行进行排序的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM