gpt4 book ai didi

c# - 如何以编程方式按多列对 UltraGrid 进行排序?

转载 作者:可可西里 更新时间:2023-11-01 07:53:17 26 4
gpt4 key购买 nike

假设我们有一个 UltraGrid。如何以编程方式首先按 A 列、B 列和 C 列对其进行排序。

谢谢!

最佳答案

文档在这里: http://help.infragistics.com/Help/Doc/WinForms/2011.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.UltraGridBand~SortedColumns.html

您可以只设置排序指示器(顺序很重要),代码取自上面的链接:

UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];

// Sort the rows by Country and City fields. Notice the order in which these columns
// are set. We want to sort by Country and then sort by City and in order to do that
// we have to set the SortIndicator property in the right order.
band.Columns["Country"].SortIndicator = SortIndicator.Ascending;
band.Columns["City"].SortIndicator = SortIndicator.Ascending;

// You can also sort (as well as group rows by) columns by using SortedColumns
// property off the band.
band.SortedColumns.Add( "ContactName", false, false );

关于第二种方法的更多信息可以在这里找到: http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.2~Infragistics.Win.UltraWinGrid.SortedColumnsCollection~Add.html

关于c# - 如何以编程方式按多列对 UltraGrid 进行排序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4937927/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com