Infragistics(R) NetAdvantage(R) Windows Forms
UltraGridAction Enumeration
Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace : UltraGridAction Enumeration

Enumerates the possible actions that can be performed on the grid

Syntax

Visual Basic (Declaration) 
Public Enum UltraGridAction 
   Inherits System.Enum
C# 
public enum UltraGridAction : System.Enum 

Members

MemberDescription
AboveCell Activates the previous visible cell in the grid above the ActiveCell. This action will span islands of data, but not bands, so the new ActiveCell will always be in the same band as the prior ActiveCell, but it may be in a row under a different parent row. This action will fail if there is no ActiveCell. If the ActiveCell is currently in edit mode, this action will attempt to exit edit mode before changing the active cell.
AboveRow Activates the previous visible row in the grid above the ActiveRow. This action will span islands of data, but not bands, so the new ActiveRow will always be in the same band as the prior ActiveRow, but it may be under a different parent row. If a cell is currently in edit mode, this action will attempt to exit edit mode before changing the active row. To span across bands, use the PrevRow action.
ActivateCell Activates the first visible cell in the ActiveRow. This action will fail if there is no active row, or if there is already an ActiveCell.
BelowCell Activates the next visible cell in the grid below the ActiveCell. This action will span islands of data, but not bands, so the new ActiveCell will always be in the same band as the prior ActiveCell, but it may be in a row under a different parent row. This action will fail if there is no ActiveCell. If the ActiveCell is currently in edit mode, this action will attempt to exit edit mode before changing the active cell.
BelowRow Activates the next visible row in the grid below the ActiveRow. This action will span islands of data, but not bands, so the new ActiveRow will always be in the same band as the prior ActiveRow, but it may be under a different parent row. If a cell is currently in edit mode, this action will attempt to exit edit mode before changing the active row. To span across bands, use the NextRow action, instead.
CloseDropdown Closes the dropdown in the ActiveCell. This action will fail if there is no ActiveCell, the ActiveCell has no dropdown, or the dropdown is not currently dropped down.
CollapseRow Collapses the active row. This action will fail if the row is already collapsed.
CommitRow When the active row is a filter row, this action evaluates the filter values input into a filter row. When the active row is an add-row, commits the add-row if it has been modified by the user. Otherwise it commits the active row.
CopyCopies the selected cells to the clipboard. This action will fail if the UltraGridOverride.AllowMultiCellOperations property does not allow Copying.
CutCopies the selected cells to the clipboard and deletes the contents of the cells. This action will fail if the UltraGridOverride.AllowMultiCellOperations property does not allow Cutting.
DeactivateCell Deactivates the ActiveCell. This action will fail if there is no ActiveCell.
DeleteCellsDeletes the contents of the selected cells. This action will fail if the UltraGridOverride.AllowMultiCellOperations property does not allow Deleting.
DeleteRowsDeletes the currently selected rows. Like all UltraGridActions, this action simulates user input, which means it will display a confirmation dialog to the user by default. To cancel the confirmation dialog, set e.DisplayPromptMsg to false in the BeforeRowsDeleted event. Or use the UltraGrid.DeleteSelectedRows method, instead of an action.
EnterEditMode Causes the ActiveCell to enter edit mode. This action will fail if there is no ActiveCell. If the grid does not have focus, it will attempt to take focus. If it fails to take focus, the action will fail.
EnterEditModeAndDropdown Causes the ActiveCell to enter edit mode and drop down it's DropDown. This action will fail if there is no ActiveCell or if the ActiveCell has no dropdown. If the grid does not have focus, it will attempt to take focus. If it fails to take focus, the action will fail.
ExitEditMode Exist edit mode on the ActiveCell. This action will fail if there is no ActiveCell of if the ActiveCell is not in edit mode.
ExpandRow Expands the active row. This action will fail if the row is already expanded.
FirstCellInBand Activates the first cell in the current island of data (the first visible cell in the first visible row of the island). This action will fail if there is no Activecell or the ActiveCell is not in the first visible column.
FirstCellInGrid Activates the first visible cell in the grid (this first visible cell in the first visible row of the root band).
FirstCellInRow Activates the first visible cell in the ActiveRow.
FirstRowInBand Activates the first visible row in the current island of data. This action will fail if there is no ActiveRow.
FirstRowInGrid Activates the first visible row in the grid. This action will fail if there is no ActiveRow in the grid.
LastCellInBand Activates the last cell in the current island of data (the last visible cell in the last visible row of the island). This action will fail if there is no Activecell or the ActiveCell is not in the last visible column.
LastCellInGrid Activates the last visible cell in the grid (this last visible cell in the last visible row of the grid).
LastCellInRow Activates the last visible cell in the ActiveRow.
LastRowInBand Activates the last visible row in the current island of data. This action will fail if there is no ActiveRow.
LastRowInGrid Activates the last visible row in the grid. This action will fail if there is no ActiveRow in the grid.
NextCell Activates the next visible cell following the ActiveCell. If the ActiveCell is in edit mode, this action will attempt to exit edit mode. If exiting edit mode fails, the action will fail. This action will span rows and bands, so it may activate a cell in the next row or a row in a child band. This action will not place the new ActiveCell into edit mode. To move to the next cell and enter edit mode, use the NextCellByTab action, instead.
NextCellByTab Activates the next visible cell following the ActiveCell and puts it into edit mode. If the ActiveCell is in edit mode, this action will attempt to exit edit mode. If exiting edit mode fails, the action will fail. This action will span rows and bands, so it may activate a cell in the next row or a row in a child band. To move to the next cell without entering edit mode, use the NextCell action, instead.
NextCellInBand Activates the next visible cell following the ActiveCell. If the ActiveCell is in edit mode, this action will attempt to exit edit mode. If exiting edit mode fails, the action will fail. This action will span rows, but not bands, so it may activate a cell in the next row, but will never leave the current island of data.
NextRegion Sets focus to the ActiveCell in the next ColScrollRegion or RowScrollRegion. This action will fail if there is no ActiveCell, if the ActiveCell is in edit mode or if there is no ColScrollRegion or RowScrollRegion to put focus on.
NextRow Activates the next visible row in the grid after the ActiveRow. This action will span bands, so if the ActiveRow is expanded and has visible child rows, the first child row will be activated. If a cell is currently in edit mode, this action will attempt to exit edit mode before changing the active row. To prevent spanning across bands, use the BelowRow action, instead.
NextRowByTab Activates the next visible row in the grid after the ActiveRow. This action will span bands, so if the ActiveRow is expanded and has visible child rows, the first child row will be activated. If a cell is currently in edit mode, this action will attempt to exit edit mode before changing the active row. To prevent spanning across bands, use the BelowRow action, instead. NextRowByTab differs from NextRow in that it will not select rows, even if the Control and Shift keys are specified true.
PageDownCell Activates a visible cell that is one page down from the ActiveCell. This action will fail if there is no ActiveCell in the grid. This action will span islands of data, but will not span bands. This means the new ActiveCell will always be a cell in the same band as the prior ActiveCell, but may be under a different parent row.
PageDownRow Activates a visible row that is one page down from the ActiveRow. This action will span islands of data, but will not span bands. This means the new ActiveRow will always be a row in the same band as the prior ActiveRow, but may be under a different parent row.
PageUpCell Activates a visible cell that is one page up from the ActiveCell. This action will fail if there is no ActiveCell in the grid. This action will span islands of data, but will not span bands. This means the new ActiveCell will always be a cell in the same band as the prior ActiveCell, but may be under a different parent row.
PageUpRow Activates a visible row that is one page up from the ActiveRow. This action will span islands of data, but will not span bands. This means the new ActiveRow will always be a row in the same band as the prior ActiveRow, but may be under a different parent row.
PastePastes cells from the clipboard to the selected cells in the grid. This action will fail if the UltraGridOverride.AllowMultiCellOperations property does not allow Pasting.
PrevCell Activates the previous visible cell relative to the ActiveCell. If the ActiveCell is in edit mode, this action will attempt to exit edit mode. If exiting edit mode fails, the action will fail. This action will span rows and bands, so it may activate a cell in the previous row or a row in a sibling or parent band. This action will not place the new ActiveCell into edit mode. To move to the previous cell and enter edit mode, use the NextCellByTab action, instead.
PrevCellByTab Activates the previous visible cell relative to the ActiveCell and puts it into edit mode. If the ActiveCell is in edit mode, this action will attempt to exit edit mode. If exiting edit mode fails, the action will fail. This action will span rows and bands, so it may activate a cell in the previous row or a row in a sibling or parent band. This action will not place the new ActiveCell into edit mode. To move to the previous cell without entering edit mode, use the NextCell action, instead.
PrevCellInBand Activates the previous visible cell relative to the ActiveCell. If the ActiveCell is in edit mode, this action will attempt to exit edit mode. If exiting edit mode fails, the action will fail. This action will span rows, but not bands, so it may activate a cell in the previous row, but will never leave the current island of data.
PrevRegion Sets focus to the ActiveCell in the previous ColScrollRegion or RowScrollRegion. This action will fail if there is no ActiveCell, if the ActiveCell is in edit mode or if there is no ColScrollRegion or RowScrollRegion to put focus on.
PrevRow Activates the previous visible row in the grid before the ActiveRow. This action will span bands, so if the ActiveRow is the first row in an island, it's parent row (or the last row in a sibling island) will be activated. If a cell is currently in edit mode, this action will attempt to exit edit mode before changing the active row. To prevent spanning across bands, use the AboveRow action, instead.
PrevRowByTab Activates the next visible row in the grid after the ActiveRow. This action will span bands, so if the ActiveRow is expanded and has visible child rows, the first child row will be activated. If a cell is currently in edit mode, this action will attempt to exit edit mode before changing the active row. To prevent spanning across bands, use the BelowRow action, instead. PrevRowByTab differs from PrevRow in that it will not select rows, even if the Control and Shift keys are specified true.
Redo Action for redoing the last undo operation.
ToggleCellSel Toggles the Selected state of the ActiveCell. This action will fail if there is no ActiveCell or if the ActiveCell is in edit mode.
ToggleCheckbox Toggles the state of the CheckBox or TriStateCheckBox in the ActiveCell. This action will fail if there is no ActiveCell or if the ActiveCell is not a CheckBox or TriStateCheckBox.
ToggleDropdown Toggles the drop down in the current ActiveCell. This method will fail if the ActiveCell has no dropdown, the grid does not have focus, or the ActiveCell is not in edit mode.
ToggleEditMode Toggles edit mode on the current cell. This action will cause the ActiveCell to enter or exit edit mode. The action will fail if there is no active cell. If a cell enters edit mode while the grid does not have focus, the grid will attempt to take focus before entering edit mode. If it fails to take focus, the action will fail.
ToggleRowSel Toggles the Selected state of the ActiveRow. This action will fail if there is no ActiveRow or if there is an ActiveCell.
Undo Action for undoing the last multi-cell cut or paste operation.
UndoCell Cancels any pending edits in the ActiveCell. This action will revert the ActiveCell to the value from the underlying DataSource and cancel any pending changes made by the user. The action will fail if there is no ActiveCell, of the ActiveCell is not in edit mode. This action will also cause the ActiveCell to exit edit mode.
UndoRow Cancels any pendits edits in the ActiveRow. This action will revert all cells in the ActiveRow to the value from the underlying DataSource, discarding any pending changes made by the user. The action will fail if there is no ActiveRow or if a cell is in edit mode.

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).

Visual BasicCopy Code
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
C#Copy Code
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.

}

See Also