RadiantQ Forum
Product => WPF Gantt Package => Topic started by: Marlene.Witsch on October 31, 2016, 12:11:35 PM
-
Is there a way to add vertical lines same as the spacing of the lowest TimeScaleHeader?
(https://ternaprod-my.sharepoint.com/personal/marlene_witsch_terna_com/_layouts/15/guestaccess.aspx?guestaccesstoken=3FAkNJcwD6q4m9zXmBkfsIaDVdXXCiZM%2bmZ69A0ghHk%3d&docid=01092132f3a82488f8a0d293527b1edd1&rev=1)
So I currently only have the gray line and would also like to have the red lines as gray grid lines.
Best regards,
Marlene
EDIT: I would like this in flexygantt
-
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.
-
Hm... But the special lines overlap over the bars... not like the gridlines
-
Marlene,
Changing the "ZIndex" value as "-1" will make special lines not to overlap over the task bars. We will consider to support this feature in source level as per request in future.
<Style TargetType="{x:Type srcview:SpecialLines}">
<Setter Property="Canvas.ZIndex" Value="-1"></Setter>
</Style>
Thanks,
- Raja.
-
Ah thank you for that info :)
Regards,
Marlene