Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread.CellType Namespace / DateTimeCellType Class / DateSeparator Property
Example


In This Topic
    DateSeparator Property (DateTimeCellType)
    In This Topic
    Gets or sets the string that separates the portions of a date value.
    Syntax
    'Declaration
     
    Public Property DateSeparator As String
    'Usage
     
    Dim instance As DateTimeCellType
    Dim value As String
     
    instance.DateSeparator = value
     
    value = instance.DateSeparator
    public string DateSeparator {get; set;}

    Property Value

    String containing the character for separating the parts of the date
    Remarks

    The date separator divides the portions of the display of the date value, separating the year, the month, and the day. For example, in the date value "06/17/02", the slash (/) character is the separator.

    Specify the format in which dates are displayed by setting the DateTimeFormat property.

    Example
    This example sets up a cell on the first sheet as a date-time cell and specifies some of the properties available.
    FarPoint.Win.Spread.CellType.DateTimeCellType datecell = new FarPoint.Win.Spread.CellType.DateTimeCellType();
    datecell.AMString = "a.m. (morning)";
    datecell.PMString = "p.m. (evening)";
    datecell.DateSeparator = " | ";
    datecell.TimeSeparator = ":";
    datecell.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDateWithTime;
    datecell.MaximumDate = new System.DateTime(2010, 1, 1);
    datecell.MinimumDate = new System.DateTime(1990, 12, 31);
    datecell.MaximumTime = new System.TimeSpan(15, 59, 59);
    datecell.MinimumTime = new System.TimeSpan(11, 0, 0);
    datecell.SpinButton = true;
    fpSpread1.Sheets[0].Cells[7,2].CellType = datecell;
    fpSpread1.Sheets[0].Cells[7,2].Value = System.DateTime.Now;
    Dim datecell As New FarPoint.Win.Spread.CellType.DateTimeCellType()
    datecell.AMString = "a.m. (morning)"
    datecell.PMString = "p.m. (evening)"
    datecell.DateSeparator = " | "
    datecell.TimeSeparator = ":"
    datecell.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDateWithTime
    datecell.MaximumDate = new System.DateTime(2010, 1, 1)
    datecell.MinimumDate = new System.DateTime(1990, 12, 31)
    datecell.MaximumTime = new System.TimeSpan(15, 59, 59)
    datecell.MinimumTime = new System.TimeSpan(11, 0, 0)
    datecell.SpinButton = True
    fpSpread1.Sheets(0).Cells(7,2).CellType = datecell
    fpSpread1.Sheets(0).Cells(7,2).Value = System.DateTime.Now
    See Also