GrapeCity CalendarGrid for Windows Forms 2.0J
DateField プロパティ
使用例 

データソースからどの日付のデータを取得する必要があるかを示す日付フィールドを取得または設定します。
構文
Public Property DateField As String
public string DateField {get; set;}

プロパティ値

データソースからどの日付のデータを取得する必要があるかを示す System.String 値。
使用例
次のサンプルコードは、GcCalendarGrid コントロールの DateField プロパティの使用方法を示します。このサンプルコードは、GcCalendarGrid.DataSource プロパティに示されている詳細なコード例の一部を抜粋したものです。
private void Form1_Load(object sender, EventArgs e)
{
    InitializeDataSource();

    // When data binding, the cells in template should be set DataField property to binding a specific column of data source.
    this.gcCalendarGrid.Template = this.CreateDataBindingTamplate();
    this.gcCalendarGrid.CalendarView = new CalendarListView();
    this.gcCalendarGrid.AutoGenerateCellType = true;

    this.gcCalendarGrid.ParseDateField += gcCalendarGrid_ParseDateField;
    this.gcCalendarGrid.FormatDateField += gcCalendarGrid_FormatDateField;
    this.gcCalendarGrid.DataSource = salesInfoDataSet.Tables["DailyRankList"];
    this.gcCalendarGrid.DateField = "Date";//This name is from the DataColumn.Name which exists in DataTable "DailyRankList";

    this.gcCalendarGrid.CellFormatting += gcCalendarGrid_CellFormatting;
    this.gcCalendarGrid.CellParsing += gcCalendarGrid_CellParsing;
}
Private Sub Form1_Load(sender As Object, e As EventArgs)
    InitializeDataSource()

    ' When data binding, the cells in template should be set DataField property to binding a specific column of data source.
    Me.gcCalendarGrid.Template = Me.CreateDataBindingTamplate()
    Me.gcCalendarGrid.CalendarView = New CalendarListView()
    Me.gcCalendarGrid.AutoGenerateCellType = True

    AddHandler Me.gcCalendarGrid.ParseDateField, AddressOf gcCalendarGrid_ParseDateField
    AddHandler Me.gcCalendarGrid.FormatDateField, AddressOf gcCalendarGrid_FormatDateField
    Me.gcCalendarGrid.DataSource = salesInfoDataSet.Tables("DailyRankList")
    Me.gcCalendarGrid.DateField = "Date"
    'This name is from the DataColumn.Name which exists in DataTable "DailyRankList";
    AddHandler Me.gcCalendarGrid.CellFormatting, AddressOf gcCalendarGrid_CellFormatting
    AddHandler Me.gcCalendarGrid.CellParsing, AddressOf gcCalendarGrid_CellParsing
End Sub
参照

GcCalendarGrid クラス
GcCalendarGrid メンバ
ParseDateField イベント
FormatDateField イベント

 

 


c 2008 GrapeCity inc. All rights reserved.