Spread ASP.NET 14
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / DateTimeCellType Class / EditMode Property
Example


In This Topic
    EditMode Property (DateTimeCellType)
    In This Topic
    Gets the format setting of a cell type in edit mode.
    Syntax
    'Declaration
     
    Public Shadows ReadOnly Property EditMode As DateTimeCellType.EditModeSettings
    'Usage
     
    Dim instance As DateTimeCellType
    Dim value As DateTimeCellType.EditModeSettings
     
    value = instance.EditMode
    public new DateTimeCellType.EditModeSettings EditMode {get;}
    Remarks
    If the EditMode property is set and the user enters edit mode in the cell, the value is displayed in the editor using the edit mode format. If the EditMode property is set and the user leaves edit mode in the cell, the value is converted to the display format if it is valid.
    Example
    This example sets a format for edit mode.
    protected void Page_Load(object sender, System.EventArgs e)
    {
    if (this.IsPostBack) return;
    FarPoint.Web.Spread.DateTimeCellType dct = new FarPoint.Web.Spread.DateTimeCellType();
    dct.DateTimeFormat = new System.Globalization.DateTimeFormatInfo();
    dct.FormatString = "yyyy/MM/dd";
    dct.EditMode.DateTimeFormat = new System.Globalization.DateTimeFormatInfo();
    dct.EditMode.FormatString = "yyyy.MM.dd";
    FpSpread1.Sheets[0].Columns[1].CellType = dct;
    }
    
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If (IsPostBack) Then
        Return
    End If
    Dim dct As New FarPoint.Web.Spread.DateTimeCellType()
    dct.DateTimeFormat = New System.Globalization.DateTimeFormatInfo()
    dct.FormatString = "yyyy/MM/dd"
    dct.EditMode.DateTimeFormat = New System.Globalization.DateTimeFormatInfo()
    dct.EditMode.FormatString = "yyyy.MM.dd"
    FpSpread1.Sheets(0).Columns(1).CellType = dct
    End Sub
    
    See Also