Marlene,
Yes, you can add special lines as vertical lines as you requested. This is already illustrated it for week headers in our "Samples\Common\DynamicSpecialLines" sample from our install.
Please replace "GenerateGridLines" method with below code in that sample to show the lines for day headers as well.
private SpecialLineInfo[] GenerateGridLines()
{
// If the week-header is the only header that's visible (then it will be the bottom most header)
TimeScaleHeaderDefinition bottomHeaderDefn = this.ganttControl.BottomTwoHeaders[0];
if (bottomHeaderDefn != null)
{
List<TimeSpanHeader> headerList = new List<TimeSpanHeader>();
// Grab hold of the TimeSpanHeader corresponding to the Weeks header.
Extensions.GetChildren<TimeSpanHeader>(this.ganttControl.GanttChart.TimeSpanHeaders, ref headerList, false, true);
TimeSpanHeader bottomHeader = null;
foreach (TimeSpanHeader header in headerList)
{
if (header.HeaderInfo.Type == bottomHeaderDefn.Type)
{
bottomHeader = header;
break;
}
}
// Based on the TimeUnits in the header, generate the SpecialLineInfos.
TimeUnits timeUnits = bottomHeader.ItemsSource as TimeUnits;
List<SpecialLineInfo> gridLines = new List<SpecialLineInfo>();
foreach (TimeUnit timeUnit in timeUnits)
{
gridLines.Add(new SpecialLineInfo() { LineDateTime = (DateTime)timeUnit.Tag, LineBrush = new SolidColorBrush(Colors.LightGray), ToolTipText = ((DateTime)timeUnit.Tag).ToString() });
}
return gridLines.ToArray<SpecialLineInfo>();
}
else
return null;
}
Thanks,
- Raja.