PowerTools CalendarGrid for Windows Forms 1.0J
AllowResize プロパティ (CalendarColumn)
使用例 

ResizeModeCalendarResizeMode.Horizontal または CalendarResizeMode.Both のときに列をリサイズできるかどうかを示す値を取得または設定します。
構文
Public Property AllowResize As Boolean
public bool AllowResize {get; set;}

プロパティ値

列をリサイズできる場合は true。それ以外の場合は false
例外
例外解説
System.InvalidOperationException列が CalendarTemplate に属していません。
解説
このプロパティは CalendarTemplate 内の列にのみ設定できます。GcCalendarGrid 内の列は、CalendarTemplate 内の関連する列からこの値を継承します。
使用例
次のサンプルコードは、最初の列をリサイズできないようにする方法を示します。このサンプルコードは、GcCalendarGrid.ResizeMode プロパティに示されている詳細なコード例の一部を抜粋したものです。
private CalendarTemplate CreateTemplate()
{
    GrapeCity.Win.CalendarGrid.CalendarTemplate calendarTemplate1 = new GrapeCity.Win.CalendarGrid.CalendarTemplate();
    GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType1 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();
    GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType2 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();
    GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType3 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();
    GrapeCity.Win.CalendarGrid.CalendarHeaderCellType calendarHeaderCellType4 = new GrapeCity.Win.CalendarGrid.CalendarHeaderCellType();

    calendarTemplate1.ColumnCount = 2;
    calendarTemplate1.ColumnHeaderRowCount = 2;

    //The first column is not allowed to resizing.
    calendarTemplate1.ColumnHeader.Columns[0].AllowResize = false;

    calendarTemplate1.RowCount = 2;
    calendarTemplate1.RowHeaderColumnCount = 0;
    calendarTemplate1.ColumnHeader.CellStyleName = "defaultStyle";
    calendarTemplate1.ColumnHeader.GetCell(0, 0).CellType = calendarHeaderCellType1;
    calendarTemplate1.ColumnHeader.GetCell(0, 0).DateFormat = "Resize Me";
    calendarTemplate1.ColumnHeader.GetCell(0, 0).RowSpan = 1;
    calendarTemplate1.ColumnHeader.GetCell(0, 0).ColumnSpan = 2;
    calendarTemplate1.ColumnHeader.GetCell(0, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter;
    calendarTemplate1.ColumnHeader.GetCell(0, 1).CellType = calendarHeaderCellType2;
    calendarTemplate1.ColumnHeader.GetCell(1, 0).CellType = calendarHeaderCellType3;
    calendarTemplate1.ColumnHeader.GetCell(1, 0).Value = "AM";
    calendarTemplate1.ColumnHeader.GetCell(1, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter;
    calendarTemplate1.ColumnHeader.GetCell(1, 1).CellType = calendarHeaderCellType4;
    calendarTemplate1.ColumnHeader.GetCell(1, 1).Value = "PM";
    calendarTemplate1.ColumnHeader.GetCell(1, 1).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter;
    calendarTemplate1.Content.CellStyleName = "defaultStyle";
    calendarTemplate1.Content.GetCell(0, 0).DateFormat = "d日";
    calendarTemplate1.Content.GetCell(0, 0).DateFormatType = GrapeCity.Win.CalendarGrid.CalendarDateFormatType.DotNet;
    calendarTemplate1.Content.GetCell(0, 0).RowSpan = 1;
    calendarTemplate1.Content.GetCell(0, 0).ColumnSpan = 2;
    return calendarTemplate1;
}
Private Function CreateTemplate() As CalendarTemplate
    Dim calendarTemplate1 As New GrapeCity.Win.CalendarGrid.CalendarTemplate()
    Dim calendarHeaderCellType1 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()
    Dim calendarHeaderCellType2 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()
    Dim calendarHeaderCellType3 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()
    Dim calendarHeaderCellType4 As New GrapeCity.Win.CalendarGrid.CalendarHeaderCellType()

    calendarTemplate1.ColumnCount = 2
    calendarTemplate1.ColumnHeaderRowCount = 2

    'The first column is not allowed to resizing.
    calendarTemplate1.ColumnHeader.Columns(0).AllowResize = False

    calendarTemplate1.RowCount = 2
    calendarTemplate1.RowHeaderColumnCount = 0
    calendarTemplate1.ColumnHeader.CellStyleName = "defaultStyle"
    calendarTemplate1.ColumnHeader.GetCell(0, 0).CellType = calendarHeaderCellType1
    calendarTemplate1.ColumnHeader.GetCell(0, 0).DateFormat = "Resize Me"
    calendarTemplate1.ColumnHeader.GetCell(0, 0).RowSpan = 1
    calendarTemplate1.ColumnHeader.GetCell(0, 0).ColumnSpan = 2
    calendarTemplate1.ColumnHeader.GetCell(0, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter
    calendarTemplate1.ColumnHeader.GetCell(0, 1).CellType = calendarHeaderCellType2
    calendarTemplate1.ColumnHeader.GetCell(1, 0).CellType = calendarHeaderCellType3
    calendarTemplate1.ColumnHeader.GetCell(1, 0).Value = "AM"
    calendarTemplate1.ColumnHeader.GetCell(1, 0).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter
    calendarTemplate1.ColumnHeader.GetCell(1, 1).CellType = calendarHeaderCellType4
    calendarTemplate1.ColumnHeader.GetCell(1, 1).Value = "PM"
    calendarTemplate1.ColumnHeader.GetCell(1, 1).CellStyle.Alignment = GrapeCity.Win.CalendarGrid.CalendarGridContentAlignment.MiddleCenter
    calendarTemplate1.Content.CellStyleName = "defaultStyle"
    calendarTemplate1.Content.GetCell(0, 0).DateFormat = "d日"
    calendarTemplate1.Content.GetCell(0, 0).DateFormatType = GrapeCity.Win.CalendarGrid.CalendarDateFormatType.DotNet
    calendarTemplate1.Content.GetCell(0, 0).RowSpan = 1
    calendarTemplate1.Content.GetCell(0, 0).ColumnSpan = 2
    Return calendarTemplate1
End Function
参照

CalendarColumn クラス
CalendarColumn メンバ
ResizeMode プロパティ

 

 


© 2014 GrapeCity inc. All rights reserved.