Version

KeyActionMappings Property (UltraListView)

Returns a collection of UltraListViewKeyActionMapping objects which define the keyboard behavior for the UltraListView control.
Syntax
'Declaration
 
Public ReadOnly Property KeyActionMappings As UltraListViewKeyActionMappings
public UltraListViewKeyActionMappings KeyActionMappings {get;}
Remarks

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

KeyCode ActionCode StateRequired StateDisallowed SpecialKeysRequired SpecialKeysDisallowed
Home ActivateFirst ItemActive ItemInEditMode None All
End ActivateLast ItemActive ItemInEditMode None All
Home ActivateFirstNoSelect ItemActive ItemInEditMode Ctrl AltShift
End ActivateLastNoSelect ItemActive ItemInEditMode Ctrl AltShift
Home ActivateFirstRangeSelect ItemActive, SupportsExtendedSelection ItemInEditMode Shift AltCtrl
End ActivateLastRangeSelect ItemActive, SupportsExtendedSelection ItemInEditMode Shift AltCtrl
Right ActivateNext ItemActive, SupportsHorizontalItemNavigation ItemInEditMode None All
Left ActivatePrevious ItemActive, SupportsHorizontalItemNavigation ItemInEditMode None All
Right ActivateNextNoSelect ItemActive, SupportsHorizontalItemNavigation ItemInEditMode Ctrl AltShift
Right ActivateNextRangeSelect ItemActive, SupportsExtendedSelection, SupportsHorizontalItemNavigation ItemInEditMode Shift AltCtrl
Left ActivatePreviousNoSelect ItemActive, SupportsHorizontalItemNavigation ItemInEditMode Ctrl AltShift
Left ActivatePreviousRangeSelect ItemActive, SupportsExtendedSelection, SupportsHorizontalItemNavigation ItemInEditMode Shift AltCtrl
Up ActivateAbove ItemActive ItemInEditMode None All
Down ActivateBelow ItemActive ItemInEditMode None All
Up ActivateAboveNoSelect ItemActive ItemInEditMode Ctrl AltShift
Down ActivateBelowNoSelect ItemActive ItemInEditMode Ctrl AltShift
Up ActivateAboveRangeSelect ItemActive, SupportsExtendedSelection ItemInEditMode Shift AltCtrl
Down ActivateBelowRangeSelect ItemActive, SupportsExtendedSelection ItemInEditMode Shift AltCtrl
Prior PageUp ItemActive ItemInEditMode None All
Next PageDown ItemActive ItemInEditMode None All
Prior PageUpNoSelect ItemActive ItemInEditMode Ctrl AltShift
Next PageDownNoSelect ItemActive ItemInEditMode Ctrl AltShift
Prior PageUpRangeSelect ItemActive, SupportsExtendedSelection ItemInEditMode Shift AltCtrl
Next PageDownRangeSelect ItemActive, SupportsExtendedSelection ItemInEditMode Shift AltCtrl
Space SelectItem ItemActive, SupportsSelection ItemInEditMode, HasCheckboxes None All
A SelectAllItems SupportsExtendedSelection ItemInEditMode Ctrl AltShift
Space ToggleItemSelectedState ItemActive, SupportsSelection ItemInEditMode, HasCheckboxes Ctrl AltShift
Space SetNextCheckStateForSelectedItems HasCheckboxes ItemInEditMode None All
F2 EnterEditMode ItemActive ItemInEditMode None All
F2 ExitEditModeSaveChanges ItemInEditMode None None All
Enter ExitEditModeSaveChanges ItemInEditMode None None All
Escape ExitEditModeDiscardChanges ItemInEditMode None None All
Left ScrollHorizontalBySmallDecrement NeedsHorizontalScrollbar ItemInEditMode, SupportsHorizontalItemNavigation None All
Right ScrollHorizontalBySmallIncrement NeedsHorizontalScrollbar ItemInEditMode, SupportsHorizontalItemNavigation None All

Example
The following code sample demonstrates how the UltraListView's KeyActionMappings collection can be used to modify the default keyboard for the control. In this example, the default mappings for the 'Home' and 'End' keys are removed, and replaced with mappings which navigate to the first/last item on an iconic row. The default mappings for 'Home' and 'End' are then remapped to require the Control key, so that the Ctrl+Home/Ctrl+End key combinations navigate to the first/last item displayed by the control, respectively:

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView

    Private Sub ModifyHomeEndKeyMappings()

        '	The custom key mappings only apply to the iconic views, and multi-column list view
        If (Me.ultraListView1.CurrentState And UltraListViewStates.SupportsHorizontalItemNavigation) = UltraListViewStates.SupportsHorizontalItemNavigation Then

            '	Iterate the KeyActionMappings collection, and remove all mappings for
            '	the 'Home' and 'End' keys
            Dim keyMappings As UltraListViewKeyActionMappings = Me.ultraListView1.KeyActionMappings
            Dim keyMapping As UltraListViewKeyActionMapping = Nothing

            Dim i As Integer
            For i = keyMappings.Count - 1 To 0 Step -1

                keyMapping = keyMappings(i)
                If (keyMapping.KeyCode = Keys.Home Or keyMapping.KeyCode = Keys.End) Then
                    keyMappings.Remove(keyMapping)
                End If

            Next

            '	Add a new UltraListViewKeyActionMapping for the Home key which uses the
            '	'ActivateFirstInIconRow' action, so that pressing the Home key navigates
            '	to the first item on the same row as the ActiveItem.
            keyMapping = New UltraListViewKeyActionMapping(Keys.Home, _
                        UltraListViewAction.ActivateFirstInIconRow, _
                        UltraListViewStates.ItemInEditMode, _
                        UltraListViewStates.SupportsHorizontalItemNavigation, _
                        SpecialKeys.All, _
                        0)

            keyMappings.Add(keyMapping)

            '	Add a new UltraListViewKeyActionMapping for the End key which uses the
            '	'ActivateLastInIconRow' action, so that pressing the End key navigates
            '	to the last item on the same row as the ActiveItem.
            keyMapping = New UltraListViewKeyActionMapping(Keys.End, _
                        UltraListViewAction.ActivateLastInIconRow, _
                        UltraListViewStates.ItemInEditMode, _
                        UltraListViewStates.SupportsHorizontalItemNavigation, _
                        SpecialKeys.All, _
                        0)

            keyMappings.Add(keyMapping)

            '	Now add a new UltraListViewKeyActionMapping for the Home key which uses the
            '	'ActivateFirst' action, and requires the Control key, so that pressing
            '	Ctrl+Home navigates to the first item displayed by the control.
            keyMapping = New UltraListViewKeyActionMapping(Keys.Home, _
                        UltraListViewAction.ActivateFirst, _
                        UltraListViewStates.ItemInEditMode, _
                        UltraListViewStates.SupportsHorizontalItemNavigation, _
                        0, _
                        SpecialKeys.Ctrl)

            keyMappings.Add(keyMapping)

            '	Now add a new UltraListViewKeyActionMapping for the End key which uses the
            '	'ActivateLast' action, and requires the Control key, so that pressing
            '	Ctrl+End navigates to the last item displayed by the control.
            keyMapping = New UltraListViewKeyActionMapping(Keys.End, _
                        UltraListViewAction.ActivateLast, _
                        UltraListViewStates.ItemInEditMode, _
                        UltraListViewStates.SupportsHorizontalItemNavigation, _
                        0, _
                        SpecialKeys.Ctrl)

            keyMappings.Add(keyMapping)
        End If
    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinListView;
using System.Diagnostics;

		private void ModifyHomeEndKeyMappings()
		{
			//	The custom key mappings only apply to the iconic views, and multi-column list view
			if ( (this.ultraListView1.CurrentState & UltraListViewStates.SupportsHorizontalItemNavigation) == UltraListViewStates.SupportsHorizontalItemNavigation )
			{
				//	Iterate the KeyActionMappings collection, and remove all mappings for
				//	the 'Home' and 'End' keys
				UltraListViewKeyActionMappings keyMappings = this.ultraListView1.KeyActionMappings;
				UltraListViewKeyActionMapping keyMapping = null;
				for ( int i = keyMappings.Count - 1; i >= 0; i-- )
				{
					keyMapping = keyMappings[i];
					if ( keyMapping.KeyCode == Keys.Home || keyMapping.KeyCode == Keys.End )
						keyMappings.Remove( keyMapping );
				}

				//	Add a new UltraListViewKeyActionMapping for the Home key which uses the
				//	'ActivateFirstInIconRow' action, so that pressing the Home key navigates
				//	to the first item on the same row as the ActiveItem.
				keyMapping = new UltraListViewKeyActionMapping( Keys.Home,
																UltraListViewAction.ActivateFirstInIconRow,
																UltraListViewStates.ItemInEditMode,
																UltraListViewStates.SupportsHorizontalItemNavigation,
																SpecialKeys.All,
																0 );

				keyMappings.Add( keyMapping );

				//	Add a new UltraListViewKeyActionMapping for the End key which uses the
				//	'ActivateLastInIconRow' action, so that pressing the End key navigates
				//	to the last item on the same row as the ActiveItem.
				keyMapping = new UltraListViewKeyActionMapping( Keys.End,
																UltraListViewAction.ActivateLastInIconRow,
																UltraListViewStates.ItemInEditMode,
																UltraListViewStates.SupportsHorizontalItemNavigation,
																SpecialKeys.All,
																0 );

				keyMappings.Add( keyMapping );

				//	Now add a new UltraListViewKeyActionMapping for the Home key which uses the
				//	'ActivateFirst' action, and requires the Control key, so that pressing
				//	Ctrl+Home navigates to the first item displayed by the control.
				keyMapping = new UltraListViewKeyActionMapping( Keys.Home,
																UltraListViewAction.ActivateFirst,
																UltraListViewStates.ItemInEditMode,
																UltraListViewStates.SupportsHorizontalItemNavigation,
																0,
																SpecialKeys.Ctrl );

				keyMappings.Add( keyMapping );

				//	Now add a new UltraListViewKeyActionMapping for the End key which uses the
				//	'ActivateLast' action, and requires the Control key, so that pressing
				//	Ctrl+End navigates to the last item displayed by the control.
				keyMapping = new UltraListViewKeyActionMapping( Keys.End,
																UltraListViewAction.ActivateLast,
																UltraListViewStates.ItemInEditMode,
																UltraListViewStates.SupportsHorizontalItemNavigation,
																0,
																SpecialKeys.Ctrl );

				keyMappings.Add( keyMapping );
			}
		}
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