PowerTools CalendarGrid for Windows Forms 1.0J
SelectedCells プロパティ
使用例 

現在の GcCalendarGrid コントロールで選択されているすべてのセルを含むコレクションを取得します。
構文
Public ReadOnly Property SelectedCells As ReadOnlyCollection(Of CalendarCellPosition)
public ReadOnlyCollection<CalendarCellPosition> SelectedCells {get;}

プロパティ値

選択されているすべてのセルを含む CalendarCellPosition の読み取り専用コレクション。
使用例
次のサンプルコードは、選択されているセルを表示します。このサンプルコードは、GcCalendarGrid.SelectionMode プロパティに示されている詳細なコード例の一部を抜粋したものです。次のサンプルコードは、選択されている日付を表示します。このサンプルコードは、GcCalendarGrid.SelectionMode プロパティに示されている詳細なコード例の一部を抜粋したものです。
void getSelectionInformationButton_Click(object sender, EventArgs e)
{
    string info = null;

    info += "Selected cells List:";

    // Get all selected cell list.
    foreach (CalendarCellPosition cell in this.gcCalendarGrid.SelectedCells)
    {
        info += "\r\n";

        info += "Date: " + cell.Date + ",RowIndex: " + cell.RowIndex + ", ColumnIndex: " + cell.ColumnIndex;
    }

    info += "\r\n\r\n";

    info += ("Selected Dates List:");

    // Get all selected row list.
    foreach (DateTime date in this.gcCalendarGrid.SelectedDates)
    {
        info += "\r\n";

        info += "DateTime: " + date;
    }

    MessageBox.Show(info);
}
Private Sub getSelectionInformationButton_Click(sender As Object, e As EventArgs)
    Dim info As String = Nothing

    info += "Selected cells List:"

    ' Get all selected cell list.
    For Each cell As CalendarCellPosition In Me.gcCalendarGrid.SelectedCells
        info += vbCr & vbLf

        info += "Date: " + cell.[Date] + ",RowIndex: " + cell.RowIndex + ", ColumnIndex: " + cell.ColumnIndex
    Next

    info += vbCr & vbLf & vbCr & vbLf

    info += ("Selected Dates List:")

    ' Get all selected row list.
    For Each [date] As DateTime In Me.gcCalendarGrid.SelectedDates
        info += vbCr & vbLf

        info += "DateTime: " + [date]
    Next

    MessageBox.Show(info)
End Sub
void getSelectionInformationButton_Click(object sender, EventArgs e)
{
    string info = null;

    info += "Selected cells List:";

    // Get all selected cell list.
    foreach (CalendarCellPosition cell in this.gcCalendarGrid.SelectedCells)
    {
        info += "\r\n";

        info += "Date: " + cell.Date + ",RowIndex: " + cell.RowIndex + ", ColumnIndex: " + cell.ColumnIndex;
    }

    info += "\r\n\r\n";

    info += ("Selected Dates List:");

    // Get all selected row list.
    foreach (DateTime date in this.gcCalendarGrid.SelectedDates)
    {
        info += "\r\n";

        info += "DateTime: " + date;
    }

    MessageBox.Show(info);
}
Private Sub getSelectionInformationButton_Click(sender As Object, e As EventArgs)
    Dim info As String = Nothing

    info += "Selected cells List:"

    ' Get all selected cell list.
    For Each cell As CalendarCellPosition In Me.gcCalendarGrid.SelectedCells
        info += vbCr & vbLf

        info += "Date: " + cell.[Date] + ",RowIndex: " + cell.RowIndex + ", ColumnIndex: " + cell.ColumnIndex
    Next

    info += vbCr & vbLf & vbCr & vbLf

    info += ("Selected Dates List:")

    ' Get all selected row list.
    For Each [date] As DateTime In Me.gcCalendarGrid.SelectedDates
        info += vbCr & vbLf

        info += "DateTime: " + [date]
    Next

    MessageBox.Show(info)
End Sub
参照

GcCalendarGrid クラス
GcCalendarGrid メンバ

 

 


© 2014 GrapeCity inc. All rights reserved.