バージョン

Add メソッド (KeyActionMappingsBase)

新しいマッピングをコレクションの最後に追加します。
シンタックス
'宣言
 
Public Function Add( _
   ByVal mapping As KeyActionMappingBase _
) As Integer
public int Add( 
   KeyActionMappingBase mapping
)

パラメータ

mapping
追加すべきマッピング

戻り値の型

追加されたマッピングのインデックス
使用例
Imports Infragistics.Win

Private Sub SetKeyMappings()
 
      ' Maps the W and Z keys to traverse the grid up and down when not in edit mode.
      If Not Me.UltraGrid1.KeyActionMappings.IsKeyMapped(Keys.Z, 0) Then
          Dim kaDown As UltraWinGrid.GridKeyActionMapping = New UltraWinGrid.GridKeyActionMapping(Keys.Z, Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow, Infragistics.Win.UltraWinGrid.UltraGridState.InEdit, 0, 0, 0)

          Me.UltraGrid1.KeyActionMappings.Add(kaDown)
      End If

      If Not Me.UltraGrid1.KeyActionMappings.IsKeyMapped(Keys.W, 0) Then
          Dim kaUp As UltraWinGrid.GridKeyActionMapping = New UltraWinGrid.GridKeyActionMapping(Keys.W, Infragistics.Win.UltraWinGrid.UltraGridAction.PrevRow, Infragistics.Win.UltraWinGrid.UltraGridState.InEdit, 0, 0, 0)

          Me.UltraGrid1.KeyActionMappings.Add(kaUp)
      End If

  End Sub
using Infragistics.Win;

private void SetKeyMappings()
{

	// Maps the W and Z keys to traverse the grid up and down when not in edit mode.
	if (!this.ultraGrid1.KeyActionMappings.IsKeyMapped(Keys.Z,0))
	{
		UltraWinGrid.GridKeyActionMapping kaDown = new UltraWinGrid.GridKeyActionMapping(Keys.Z,Infragistics.Win.UltraWinGrid.UltraGridAction.NextRow,Infragistics.Win.UltraWinGrid.UltraGridState.InEdit  ,0,0,0);

		this.ultraGrid1.KeyActionMappings.Add(kaDown);
	}

	if (!this.ultraGrid1.KeyActionMappings.IsKeyMapped(Keys.W,0))
	{
		UltraWinGrid.GridKeyActionMapping kaUp = new UltraWinGrid.GridKeyActionMapping(Keys.W,Infragistics.Win.UltraWinGrid.UltraGridAction.PrevRow,Infragistics.Win.UltraWinGrid.UltraGridState.InEdit ,0,0,0);

		this.ultraGrid1.KeyActionMappings.Add(kaUp);
	}

}
参照