MESCIUS SPREAD for ASP.NET 10.0J
DateTimeFormat プロパティ (DateTimeCellType.EditModeSettings)

日付と時刻の編集書式を定義するDateTimeFormatInfoを取得または設定します。
構文
'Declaration
 
Public Property DateTimeFormat As DateTimeFormatInfo
public DateTimeFormatInfo DateTimeFormat {get; set;}
解説
EditModeプロパティが設定されている場合、ユーザーがセルを編集モードにすると、編集モードの書式を使用して値がエディタに表示されます。EditModeプロパティが設定されている場合、ユーザーがセルの編集モードを終了すると、値が表示書式に変換されます(値が有効な場合)。
次のサンプルコードは、編集モードの書式を設定します。
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
参照

DateTimeCellType.EditModeSettings クラス
DateTimeCellType.EditModeSettings メンバ

 

 


© MESCIUS inc. All rights reserved.