PowerTools CalendarGrid for Windows Forms 1.0J
週番号を表示する

週番号を表示するには、週スタイルのカレンダーに行ヘッダを追加し、行ヘッダのセルに"{WeekNumber}"書式を設定します。

Imports GrapeCity.Win.CalendarGrid

Dim template As CalendarTemplate = GcCalendarGrid1.Template
template.RowHeaderColumnCount = 1
template.RowHeader.Columns(0).Width = 30
template.RowHeader(0, 0).RowSpan = 4
template.RowHeader(0, 0).DateFormat = "{WeekNumber}"
template.RowHeader(0, 0).DateFormatType = CalendarDateFormatType.CalendarGrid

Dim weekView As New CalendarWeekView()
weekView.WeekCount = 1
GcCalendarGrid1.CalendarView = weekView
using GrapeCity.Win.CalendarGrid;

CalendarTemplate template = gcCalendarGrid1.Template;
template.RowHeaderColumnCount = 1;
template.RowHeader.Columns[0].Width = 30;
template.RowHeader[0, 0].RowSpan = 4;
template.RowHeader[0, 0].DateFormat = "{WeekNumber}";
template.RowHeader[0, 0].DateFormatType = CalendarDateFormatType.CalendarGrid;

var weekView = new CalendarWeekView();
weekView.WeekCount = 1;
gcCalendarGrid1.CalendarView = weekView;

週番号の計算方法は、GcCalendarGrid.DateFormatInfo.CalendarWeekRuleプロパティで設定します。

参照

 

 


© 2014 GrapeCity inc. All rights reserved.