Version

ReadOnly Property (UltraCalendarCombo)

Determines whether the edit portion of the combo is editable.
Syntax
'Declaration
 
Public Property ReadOnly As Boolean
public bool ReadOnly {get; set;}
Example
This example makes the edit portion of the control read-only if the selected date does not fall in the current month.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports Infragistics.Win.UltraWinSchedule.CalendarCombo

    Private Sub LockEditPortionIfNotCurrentMonth()

        '--------------------------------------------------------------------------------
        '	ReadOnly
        '	Value
        '
        '	This example makes the edit portion of the control read-only if the
        '	selected date does not fall in the current month
        '--------------------------------------------------------------------------------

        '	If the value is null, make the edit portion read-only
        If (Me.ultraCalendarCombo1.Value Is Nothing) Then
            Me.ultraCalendarCombo1.ReadOnly = True
        Else
            Try
                '	If the not in the current month, make the edit portion read-only
                Dim dateValue As DateTime = Me.ultraCalendarCombo1.Value
                If (dateValue.Month <> DateTime.Today.Month) Then
                    Me.ultraCalendarCombo1.ReadOnly = True
                Else
                    Me.ultraCalendarCombo1.ReadOnly = False
                End If
            Catch
                Me.ultraCalendarCombo1.ReadOnly = False
            End Try
        End If

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

		private void LockEditPortionIfNotCurrentMonth()
		{

			//--------------------------------------------------------------------------------
			//	ReadOnly
			//	Value
			//
			//	This example makes the edit portion of the control read-only if the
			//	selected date does not fall in the current month
			//--------------------------------------------------------------------------------

			//	If the value is null, make the edit portion read-only
			if ( this.ultraCalendarCombo1.Value == null )
			{
				this.ultraCalendarCombo1.ReadOnly = true;
			}
			else
			if ( this.ultraCalendarCombo1.Value is DateTime )				 
			{
				//	If the not in the current month, make the edit portion read-only
				DateTime dateValue = (DateTime)(this.ultraCalendarCombo1.Value);
				if ( dateValue.Month != DateTime.Today.Month )
					this.ultraCalendarCombo1.ReadOnly = true;
				else
					this.ultraCalendarCombo1.ReadOnly = false;
			}

		}
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