'宣言 Public ReadOnly Property SortedColumns As SortedColumnsCollection
public SortedColumnsCollection SortedColumns {get;}
Imports Infragistics.Win Imports Infragistics.Win.Layout Imports Infragistics.Win.UltraWinTree Private Sub ultraTree1_AfterSortChange(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.AfterSortChangeEventArgs) Handles ultraTree1.AfterSortChange Debug.WriteLine("Column '" + e.OriginalSortedColumns(0).TextResolved + "' was sorted.") End Sub Private Sub ultraTree1_BeforeSortChange(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.BeforeSortChangeEventArgs) Handles ultraTree1.BeforeSortChange ' Disallow sorting more than one column If e.SortedColumns.Count > 1 Then e.Cancel = True End Sub
using Infragistics.Win; using Infragistics.Win.Layout; using Infragistics.Win.UltraWinTree; using System.Diagnostics; private void ultraTree1_AfterSortChange(object sender, Infragistics.Win.UltraWinTree.AfterSortChangeEventArgs e) { Debug.WriteLine( "Column '" + e.OriginalSortedColumns[0].TextResolved + "' was sorted."); } private void ultraTree1_BeforeSortChange(object sender, Infragistics.Win.UltraWinTree.BeforeSortChangeEventArgs e) { // Disallow sorting more than one column if ( e.SortedColumns.Count > 1 ) e.Cancel = true; }