バージョン

BeforeColPosChangedEventArgs クラス

BeforeColPosChangedイベントに使用されるイベントパラメーターです。
シンタックス
'宣言
 
Public Class BeforeColPosChangedEventArgs 
   Inherits System.ComponentModel.CancelEventArgs
public class BeforeColPosChangedEventArgs : System.ComponentModel.CancelEventArgs 
使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub UltraGrid1_BeforeColPosChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeColPosChangedEventArgs) Handles ultraGrid1.BeforeColPosChanged

       ' ユーザーが列を移動、切り替え、サイズ変更するときに BeforeColPosChanged を
       ' 発生しますこのイベントでは、ユーザー操作をキャンセルできます

       If PosChanged.Moved = e.PosChanged Then

           ' 1 つ以上の列が移動されています

           Dim columnList As String = ""

           Dim i As Integer
           For i = 0 To e.ColumnHeaders.Length - 1
               If i > 0 Then columnList = columnList & ", "

               columnList = columnList + e.ColumnHeaders(i).Column.Key
           Next

           Dim result As DialogResult = MessageBox.Show( _
               "You are about to move " & columnList & " columns. Do you want to continue ?", _
               "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

           If DialogResult.No = result Then
               ' 移動をキャンセルするには、イベント引数の Cancel を設定します
               e.Cancel = True
           End If

       ElseIf PosChanged.Swapped = e.PosChanged Then

           ' 2 つの列が入れ替えられています

           Dim result As DialogResult = MessageBox.Show( _
               "You are about to swap " & e.ColumnHeaders(0).Column.Key & " with " _
               + e.ColumnHeaders(1).Column.Key & " Do you want to continue ?", _
               "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

           If DialogResult.No = result Then
               ' 移動をキャンセルするには、イベント引数の Cancel を設定します
               e.Cancel = True
           End If

       ElseIf PosChanged.Sized = e.PosChanged Then

           ' 列のサイズが変更されています

           ' 列のサイズが変更されているときに、e.ColumnHeaders はサイズ変更されている
           ' 列ヘッダーを含みます
           Debug.WriteLine("User is about to resize " & e.ColumnHeaders(0).Column.Key & " colun.")

       End If

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_BeforeColPosChanged(object sender, Infragistics.Win.UltraWinGrid.BeforeColPosChangedEventArgs e)
{

	// ユーザーが列を移動、切り替え、またはサイズ変更するときに BeforeColPosChanged を
	// 発生しますこのイベントでは、ユーザー操作をキャンセルできます

	if ( PosChanged.Moved == e.PosChanged )
	{
		// 1 つ以上の列が移動されています

		string columnList = "";
		
		for ( int i = 0; i < e.ColumnHeaders.Length; i++ )
		{
			if ( i > 0 )
				columnList = columnList + ", ";

			columnList = columnList + e.ColumnHeaders[i].Column.Key;
		}

		DialogResult result = MessageBox.Show( 
			"You are about to move " + columnList + " columns. Do you want to continue ?",
			"Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question );

		if ( DialogResult.No == result )
		{
			// 移動をキャンセルするには、イベント引数の Cancel を設定します
			e.Cancel = true;
		}
	}
	else if ( PosChanged.Swapped == e.PosChanged )
	{
		// 2 つの列が入れ替えられています

		DialogResult result = MessageBox.Show( 
			"You are about to swap " + e.ColumnHeaders[0].Column.Key + " with " 
					+ e.ColumnHeaders[1].Column.Key + " Do you want to continue ?", 
			"Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question );

		if ( DialogResult.No == result )
		{
			// 移動をキャンセルするには、イベント引数の Cancel を設定します
			e.Cancel = true;
		}
	}
	else if ( PosChanged.Sized == e.PosChanged )
	{
		// 列のサイズが変更されています

		// 列のサイズが変更されているときに、e.ColumnHeaders はサイズ変更されている
		// 列ヘッダーを含みます
		Debug.WriteLine( "User is about to resize " + e.ColumnHeaders[0].Column.Key + " colun." );
	}

}
参照