Spread Windows Forms 10.0 Product Documentation
TimeDefault Property
Example 


Gets or sets the default time used in the control.
Syntax
'Declaration
 
Public Overridable Property TimeDefault As Date
'Usage
 
Dim instance As DateTimeCellType
Dim value As Date
 
instance.TimeDefault = value
 
value = instance.TimeDefault
public virtual DateTime TimeDefault {get; set;}

Property Value

DateTime object containing the default time
Remarks

Spread uses this property to fill in the time portion that is not set into the cell, typically when dates are entered and times are ignored. When the user enters a date into a date-time cell and no time is specified, the value of this property is used.

When the user sets the date in the cell with the pop-up calendar, the time is set to midnight. If you want a different time, you would need to catch the SubEditorClosed event and change the value in the cell.

You can also create your own sub-editor to create a clock and calendar form to pop-up for the cell. You can refer to the ISubEditor interface for more information on how to implement this.

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;
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

DateTimeCellType Class
DateTimeCellType Members

 

 


Copyright © GrapeCity, inc. All rights reserved.