'宣言 Public Delegate Sub AfterGroupPosChangedEventHandler( _ ByVal sender As Object, _ ByVal e As AfterGroupPosChangedEventArgs _ )
public delegate void AfterGroupPosChangedEventHandler( object sender, AfterGroupPosChangedEventArgs e )
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Imports System.Diagnostics Private Sub UltraGrid1_AfterGroupPosChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.AfterGroupPosChangedEventArgs) Handles ultraGrid1.AfterGroupPosChanged ' ユーザーがグループを移動、入れ替え、またはサイズ変更した後に AfterGroupPosChanged を ' 発生します If PosChanged.Moved = e.PosChanged Then ' 1 つ以上のグループが移動されました Debug.WriteLine("Following are the new positions of the groups:") Dim i As Integer For i = 0 To e.GroupHeaders.Length - 1 Debug.WriteLine(" " & e.GroupHeaders(i).Caption & " is moved to the new visible index of " & e.GroupHeaders(i).VisiblePosition) Next ElseIf PosChanged.Swapped = e.PosChanged Then ' 2 つのグループが入れ替えられています Debug.WriteLine(e.GroupHeaders(0).Caption & " and " & e.GroupHeaders(1).Caption & " groups have been swapped.") ElseIf PosChanged.Sized = e.PosChanged Then ' グループがサイズ変更されました Debug.WriteLine(e.GroupHeaders(0).Caption & " has been resized to the new width of " & e.GroupHeaders(0).Caption) End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_AfterGroupPosChanged(object sender, Infragistics.Win.UltraWinGrid.AfterGroupPosChangedEventArgs e) { // ユーザーがグループを移動、入れ替え、サイズ変更した後に AfterGroupPosChanged を // 発生します if ( PosChanged.Moved == e.PosChanged ) { // 1 つ以上のグループが移動されています Debug.WriteLine( "Following are the new positions of the groups:" ); for ( int i = 0; i < e.GroupHeaders.Length; i++ ) { Debug.WriteLine( " " + e.GroupHeaders[i].Caption + " is moved to the new visible index of " + e.GroupHeaders[i].VisiblePosition ); } } else if ( PosChanged.Swapped == e.PosChanged ) { // 2 つのグループが入れ替えられています Debug.WriteLine( e.GroupHeaders[0].Caption + " and " + e.GroupHeaders[1].Caption + " groups have been swapped." ); } else if ( PosChanged.Sized == e.PosChanged ) { // グループがサイズ変更されています Debug.WriteLine( e.GroupHeaders[0].Caption + " has been resized to the new width of " + e.GroupHeaders[0].Caption ); } }