バージョン 24.2 (最新)

BeforeCellActivate イベント

セルがアクティブになる前に発生します。
シンタックス
public event CancelableCellEventHandler BeforeCellActivate
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、CancelableCellEventArgs 型の引数を受け取りました。次の CancelableCellEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
Cancel System.ComponentModel.CancelEventArgsから継承されます。 
Cell 対象となるセルへの参照を返します。
解説

cell 引数は、アクティベートされるセルでプロパティを設定でき、メソッドを呼び出す UltraGridCell オブジェクトへの参照を返します。この参照を使用して、返されるセルのプロパティまたはメソッドにアクセスできます。

cancel 引数を使用して、行がアクティブされないようにプログラミングできます。一定の条件が満たされない限り、セルがアクティベートされないようにすることが可能です。

このイベントは、セルがアクティブになる前、つまり行がフォーカスを取得する前に生成されます。

BeforeCellDeactivate イベントは、セルが非アクティブになる前、つまり行がフォーカスを失う前に生成されます。

cancel を True に設定しない場合、このイベントの後に AfterCellActivate イベント (セルがアクティブされるに発生するイベント) が発生します。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub UltraGrid1_BeforeCellActivate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelableCellEventArgs) Handles ultraGrid1.BeforeCellActivate

      ' Set the appearance of the cell right before the cell is about to be activated.
      ' In the BeforeCellDeactivate, we will reset the BackColor.
      e.Cell.Appearance.BackColor = Color.LightYellow

  End Sub

  Private Sub UltraGrid1_BeforeCellDeactivate(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ultraGrid1.BeforeCellDeactivate

      ' Reset BackColor the appearance of the cell right before the cell is about
      ' to be deactivated.
      Me.ultraGrid1.ActiveCell.Appearance.ResetBackColor()

  End Sub
'宣言
 
Public Event BeforeCellActivate As CancelableCellEventHandler
 
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_BeforeCellActivate(object sender, Infragistics.Win.UltraWinGrid.CancelableCellEventArgs e)
{

	// Set the appearance of the cell right before the cell is about to be activated.
	// In the BeforeCellDeactivate, we will reset the BackColor.
	e.Cell.Appearance.BackColor = Color.LightYellow;

}

private void ultraGrid1_BeforeCellDeactivate(object sender, System.ComponentModel.CancelEventArgs e)
{

	// Reset BackColor the appearance of the cell right before the cell is about
	// to be deactivated.
	this.ultraGrid1.ActiveCell.Appearance.ResetBackColor( );

}
'宣言
 
Public Event BeforeCellActivate As CancelableCellEventHandler
 
参照