UltraGridがあるとします。プログラムで最初に列A、次にB、次にCで並べ替えるにはどうすればよいですか。
ありがとう!
上記のリンクから取得したコードであるソートインジケーター(順序は重要)を設定するだけです。
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 );
2番目の方法の詳細については、http: //help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.2~Infragistics.Win.UltraWinGridを参照してください。 .SortedColumnsCollection〜Add.html
ContactNameで自動的にグループ化する場合も、次のようになります。
band.SortedColumns.Add( "ContactName", false, true);
最後のパラメータとしてtrueが使用されていることに注意してください