Version

KeyActionMappings Property (UltraCombo)

Gives you the ability to reconfigure the way the control responds to user keystrokes.
Syntax
'Declaration
 
Public ReadOnly Property KeyActionMappings As ComboKeyActionMappings
public ComboKeyActionMappings KeyActionMappings {get;}
Remarks

The KeyActionMappings property provides access to the control's mechanism for handling keyboard input from users. All keystrokes for actions such as selection, navigation and editing are stored in a table-based system that you can examine and modify using this property. Through the KeyActionsMappings property, you can customize the keyboard layout of the control to match your own standards for application interactivity.

For example, if you wanted users to be able to navigate between cells by pressing the F8 key, you could add this behavior. You can specify the key code and any special modifier keys associated with an action, as well as determine whether a key mapping applies in a given context.

The following table lists the default key mappings for the UltraCombo control:

KeyCode ActionCode StateRequired StateDisallowed SpecialKeysRequired SpecialKeysDisallowed
Up PrevRow Row Alt
Down NextRow Row Alt
Up FirstRow Row Alt
Down FirstRow Row Alt
Right FirstRow Row, HasEdit Alt
Left FirstRow Row, HasEdit Alt
Home FirstRow IsDroppedDown AltCtrl
End LastRow IsDroppedDown AltCtrl
Right NextRow Row HasEdit Alt
Left PrevRow Row HasEdit Alt
Prior PageUp Row Alt
Next PageDown Row Alt
Escape CloseDropdown IsDroppedDown Alt
Enter CloseDropdown IsDroppedDown Alt
F4 ToggleDropdown Alt
Up ToggleDropdown Alt
Down ToggleDropdown Alt

Example
The following code illustrates how to add a custom key/action mapping to the grid that will navigate to the first row in the grid when the grid has focus but is not in edit mode and the users presses the ‘H’ key (unless the ‘alt’ key is also pressed).

Imports Infragistics.Win.UltraWinGrid

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

     Dim newMapping As GridKeyActionMapping

    ' Add a custom key/action mapping to the grid that 
    ' will navigate to the first row in the grid when 
    ' the grid has focus but is not in edit mode 
    ' and the users presses the ‘H’ key (unless the
    ' 'alt’ key is also pressed). 
    newMapping = New GridKeyActionMapping(Keys.H, UltraGridAction.FirstRowInGrid, UltraGridState.InEdit, 0, Infragistics.Win.SpecialKeys.Alt, 0)

    Me.ultraGrid1.KeyActionMappings.Add(newMapping)

    ' Note: The concept applies to UltraCombo controls as
    ' well except that the combo's KeyActionMappings is
    ' a collection of a mapping class, and associated
    ' state and actiion flags, that make sense for a combo
    ' (i.e. ComboKeyActionMapping, UltraComboAction and
    ' UltraComboState.

End Sub
using Infragistics.Win.UltraWinGrid;

private void Form1_Load(object sender, System.EventArgs e)
{

	this.oleDbDataAdapter1.Fill( this.dataSet11 );

	// Add a custom key/action mapping to the grid that 
	// will navigate to the first row in the grid when 
	// the grid has focus but is not in edit mode 
	// and the users presses the ‘H’ key (unless the
	// 'alt’ key is also pressed). 
	this.ultraGrid1.KeyActionMappings.Add( 
		new GridKeyActionMapping( 
			// the key code
			Keys.H,
			// the action to take
			UltraGridAction.FirstRowInGrid,
			// disallowed state
			UltraGridState.InEdit, 
			// required state (none)
			0, 
			// disallowed special keys
			Infragistics.Win.SpecialKeys.Alt, 
			// required special keys (none)
			0 ) );

	// Note: The concept applies to UltraCombo controls as
	// well except that the combo's KeyActionMappings is
	// a collection of a mapping class, and associated
	// state and actiion flags, that make sense for a combo
	// (i.e. ComboKeyActionMapping, UltraComboAction and
	// UltraComboState.

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also