CalendarGridでは、既定でユーザーが列や行のサイズを変更できます。列や行をリサイズするには、マウスカーソルをヘッダの境界に移動し、マウスカーソルがサイズ変更用の形になった時点でドラッグ操作します。
この操作を一律に禁止するには、GcCalendarGrid.ResizeModeプロパティをNoneに設定します。
GcCalendarGrid1.ResizeMode = GrapeCity.Win.CalendarGrid.CalendarResizeMode.None
gcCalendarGrid1.ResizeMode = GrapeCity.Win.CalendarGrid.CalendarResizeMode.None;
特定の列だけを個別にリサイズ禁止にするには、AllowResizeプロパティをFalseに設定します。この機能はテンプレートに対してのみ適用できます。
Imports GrapeCity.Win.CalendarGrid
Dim template As New CalendarTemplate()
template.ColumnCount = 3
template.ColumnHeader.Columns(0).AllowResize = true
template.ColumnHeader.Rows(0).Cells(0).Value = "リサイズ可能"
template.ColumnHeader.Columns(1).AllowResize = false
template.ColumnHeader.Rows(0).Cells(1).Value = "リサイズ不可"
template.ColumnHeader.Columns(2).AllowResize = true
template.ColumnHeader.Rows(0).Cells(2).Value = "リサイズ可能"
template.Content.Rows(0).Cells(0).DateFormat = "yyyy/MM/dd"
template.Content.Rows(0).Cells(0).DateFormatType = CalendarDateFormatType.DotNet
gcCalendarGrid1.Template = template
Dim listView As New CalendarListView()
listView.Orientation = Orientation.Vertical
gcCalendarGrid1.CalendarView = listView
using GrapeCity.Win.CalendarGrid;
var template = new CalendarTemplate();
template.ColumnCount = 3;
template.ColumnHeader.Columns[0].AllowResize = true;
template.ColumnHeader.Rows[0].Cells[0].Value = "リサイズ可能";
template.ColumnHeader.Columns[1].AllowResize = false;
template.ColumnHeader.Rows[0].Cells[1].Value = "リサイズ不可";
template.ColumnHeader.Columns[2].AllowResize = true;
template.ColumnHeader.Rows[0].Cells[2].Value = "リサイズ可能";
template.Content.Rows[0].Cells[0].DateFormat = "yyyy/MM/dd";
template.Content.Rows[0].Cells[0].DateFormatType = CalendarDateFormatType.DotNet;
gcCalendarGrid1.Template = template;
var listView = new CalendarListView();
listView.Orientation = Orientation.Vertical;
gcCalendarGrid1.CalendarView = listView;
コーディングで列や行の高さを変更するには、GcCalendarGrid.LayoutSettingsプロパティを使用します。
' 行の高さを変更する
GcCalendarGrid1.LayoutSettings.SetVerticalLength(0, 50)
' 列の幅を変更する
GcCalendarGrid1.LayoutSettings.SetHorizontalLength(1, 300)
// 行の高さを変更する
gcCalendarGrid1.LayoutSettings.SetVerticalLength(0, 50);
// 列の幅を変更する
gcCalendarGrid1.LayoutSettings.SetHorizontalLength(1, 300);
関連トピック