Spread Windows Forms 12.0 Product Documentation
TwoDigitYearMax Property (DateTimeCellType)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > DateTimeCellType Class : TwoDigitYearMax Property
Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.
Syntax
'Declaration
 
Public Property TwoDigitYearMax As Integer
'Usage
 
Dim instance As DateTimeCellType
Dim value As Integer
 
instance.TwoDigitYearMax = value
 
value = instance.TwoDigitYearMax
public int TwoDigitYearMax {get; set;}

Property Value

Integer two-digit year
Exceptions
ExceptionDescription
Specified value is out of range for Gregorian calendar; must be between 100 and 9999
Specified value is out of range for Hijri calendar; must be between 100 and 9666
Specified value is out of range for Hebrew calendar; must be between 5343 and 6000
Remarks

The control determines the century value for two-digit years by placing the year in the range between the value of this property and the value of this property minus 99 years. To change the calculation year, provide a four-digit value.

Tip: For best results, prompt your user for and represent dates with four-digit year values. Four-digit year values eliminate possible misunderstanding of year data.

The maximum year you can specify for the calculation year (for a Gregorian calendar) is 9999. The minimum year you can specify for the calculation year (for a Gregorian calendar) is 1100.

Example
This example sets the default date for the cell.
FarPoint.Win.Spread.CellType.DateTimeCellType dt = new FarPoint.Win.Spread.CellType.DateTimeCellType(); 
dt.DateDefault = System.DateTime.Now; 
dt.TimeDefault = System.DateTime.Now; 
dt.TwoDigitYearMax = 2000;
FarPoint.Win.Spread.CellType.DateTimeCellType dt = new FarPoint.Win.Spread.CellType.DateTimeCellType(); 
dt.DateDefault = System.DateTime.Now; 
dt.TimeDefault = System.DateTime.Now; 
dt.TwoDigitYearMax = 2000;
See Also

Reference

DateTimeCellType Class
DateTimeCellType Members