用代码设置时间标尺
可以用代码设置时间标尺,例如:
Dim
gv
As
GanttView = e.Form.Controls("GanttView1").GanttView
'设置中间时间刻度
gv.Timescale.MiddleTier.Units = Gantt.TimescaleUnits.Weeks
'时间单位为周
gv.Timescale.MiddleTier.Format =
"第k周"
'显示格式为第几周
gv.Timescale.MiddleTier.Visible =
True
'设置底层时间刻度,因为默认单位是日
gv.Timescale.BottomTier.Align = C1.Win.C1GanttView.ScaleLabelAlignment.Center
'文本居中
gv.Timescale.BottomTier.Units = C1.Win.C1GanttView.TimescaleUnits.Days
'时间单位为日
gv.Timescale.BottomTier.Format =
"w"
'显示格式为星期几
gv.Timescale.BottomTier.MinWidth = 22
'列宽至少为22
gv.Timescale.BottomTier.Visible =
True
执行后的时间刻度如下图: