private void Button_Click(object sender, RoutedEventArgs e)
{
List<GanttScheduleRowInfo> RowInfo = new List<GanttScheduleRowInfo>();
if (Gantt.ScheduleType == ScheduleType.CustomNumeric)
{
Gantt.ScheduleType = ScheduleType.CustomDateTime;
button.Content = "CustomDateTime";
RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Years, CellsPerUnit = 1 });
RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Months, CellsPerUnit = 3, PixelsPerUnit = 30 });
Gantt.CustomScheduleSource = RowInfo;
}
else
{
Gantt.ScheduleType = ScheduleType.CustomNumeric;
button.Content = "CustomNumeric";
RowInfo.Add(new GanttScheduleRowInfo() { CellsPerUnit = 5 });
RowInfo.Add(new GanttScheduleRowInfo() { CellsPerUnit = 2, PixelsPerUnit = 30d });
Gantt.CustomScheduleSource = RowInfo;
}
} |
Gantt.ScheduleType = ScheduleType.CustomDateTime;
button.Content = "CustomDateTime";
RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Weeks });
RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Days });
RowInfo.Add(new GanttScheduleRowInfo() { TimeUnit = TimeUnit.Hours,PixelsPerUnit=30 });
Gantt.CustomScheduleSource = RowInfo; |