Spread for ASP.NET 7.0 Product Documentation
DateTimeFormat Property
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > DateTimeCellType Class : DateTimeFormat Property


Glossary Item Box

Gets or sets a DateTimeFormatInfo that defines the format for displaying dates and times.

Syntax

Visual Basic (Declaration) 
Public Overrides Property DateTimeFormat As DateTimeFormatInfo
Visual Basic (Usage)Copy Code
Dim instance As DateTimeCellType
Dim value As DateTimeFormatInfo
 
instance.DateTimeFormat = value
 
value = instance.DateTimeFormat
C# 
public override DateTimeFormatInfo DateTimeFormat {get; set;}

Property Value

DateTimeFormatInfo object containing the format for date-time values

Example

C#Copy Code
FarPoint.Web.Spread.DateTimeCellType dt = new FarPoint.Web.Spread.DateTimeCellType();
System.Globalization.DateTimeFormatInfo dtf = new System.Globalization.DateTimeFormatInfo();
dtf.LongDatePattern = "D";
dtf.ShortDatePattern = "M/d/yyyy";
dt.DateTimeFormat = dtf;
dt.MaximumValue = new Date(2020, 12, 31);
dt.MinimumValue = new Date(1950, 1, 1);
FpSpread1.ActiveSheetView.Cells[0, 0].CellType = dt;
FpSpread1.ActiveSheetView.Cells[0, 0].Value = DateTime.Now;
Visual BasicCopy Code
Dim dt As New FarPoint.Web.Spread.DateTimeCellType
Dim dtf As New System.Globalization.DateTimeFormatInfo
dtf.LongDatePattern = "D"
dtf.ShortDatePattern = "M/d/yyyy"
dt.DateTimeFormat = dtf
dt.MaximumValue = New Date(2020, 12, 31)
dt.MinimumValue = New Date(1950, 1, 1)
FpSpread1.ActiveSheetView.Cells(0, 0).CellType = dt
FpSpread1.ActiveSheetView.Cells(0, 0).Value = DateTime.Now

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.