Version

PerformKeyAction Method (UltraDayView)

Performs a specific key action
Syntax
'Declaration
 
Public Overridable Function PerformKeyAction( _
   ByVal actionCode As UltraDayViewAction, _
   ByVal shift As Boolean, _
   ByVal control As Boolean _
) As Boolean
public virtual bool PerformKeyAction( 
   UltraDayViewAction actionCode,
   bool shift,
   bool control
)

Parameters

actionCode
An enumeration value that determines the user action to be performed.
shift
A booean specifies whether the action should be performed as if the shift key is depressed. This mainly affects actions where selection is involved and determines if the existing selection is extended, as it is when the user holds down the shift key and selects a range of rows in a grid.
control
A booean specifies whether the action should be performed as if the control key is depressed. This mainly affects actions where selection is involved and determines if the existing selection is maintained, as it is when the user holds down the control key and selects a row in a grid.

Return Value

true if the action completed successfully, false if the action failed.
Remarks

Invoke this method to simulate an action the user can perform.

Many actions are only appropriate in certain situations; if an action is inappropriate, it will not be performed. For example, attempting to delete appointments by performing the DeleteSelectedAppointments action will have no effect if no appointments are selected.

You can use the CurrentState property to determine the state of the control when the action is about to be performed.

Example
The following code demonstrates how to perform a built-in UltraDayView action in response to a button being clicked. The action to be performed is to select the same time slot in the next day.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

	Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

		' Get the current state of the UltraDayView control
		Dim state As UltraDayViewState = Me.UltraDayView1.CurrentState

		' Check the state bit flags to see if a time slot is selected
		If (state And UltraDayViewState.TimeSlotSelected) <> 0 Then

			' Since a time slot is selected, call PerformAction
			' to select the same time slot in the next day.
			Me.UltraDayView1.PerformAction(UltraDayViewAction.SameTimeSlotNextDay)
		End If

	End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

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

			// Get the current state of the UltraDayView control
			UltraDayViewState state = this.ultraDayView1.CurrentState;

			// Check the state bit flags to see if a time slot is selected
			if ((state & UltraDayViewState.TimeSlotSelected) != 0)
			{
				// Since a time slot is selected, call PerformAction
				// to select the same time slot in the next day.
				this.ultraDayView1.PerformAction(UltraDayViewAction.SameTimeSlotNextDay);
			}

		}
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