GcCalendarGrid コントロールの
VirtualMode プロパティが
true の場合に、セルの値が変更されて基になるデータソースへの格納が必要となったときに発生します。
イベント ハンドラが、このイベントに関連するデータを含む、CalendarCellValueEventArgs 型の引数を受け取りました。次の CalendarCellValueEventArgs プロパティには、このイベントの固有の情報が記載されます。
次のサンプルコードは、このイベントを通じて GcCalendarGrid にデータを提供する方法を示します。このサンプルコードは、
VirtualMode プロパティに示されている詳細なコード例の一部を抜粋したものです。
void gcCalendarGrid_CellValuePushed(object sender, CalendarCellValueEventArgs e)
{
if (_valueCache.ContainsKey(e.CellPosition))
{
//Same the value by your own.
_valueCache[e.CellPosition] = e.Value;
}
else
{
_valueCache.Add(e.CellPosition, e.Value);
//If the value is saved by user, change the back color.
this.gcCalendarGrid[e.CellPosition.Date][e.CellPosition.RowIndex, e.CellPosition.ColumnIndex].CellStyle.BackColor = Color.Lime;
}
}
Private Sub gcCalendarGrid_CellValuePushed(sender As Object, e As CalendarCellValueEventArgs)
If _valueCache.ContainsKey(e.CellPosition) Then
'Same the value by your own.
_valueCache(e.CellPosition) = e.Value
Else
_valueCache.Add(e.CellPosition, e.Value)
'If the value is saved by user, change the back color.
Me.gcCalendarGrid(e.CellPosition.[Date])(e.CellPosition.RowIndex, e.CellPosition.ColumnIndex).CellStyle.BackColor = Color.Lime
End If
End Sub