|
<sync:GanttControl x:Name="Gantt" Loaded="Gantt_Loaded"
ItemsSource="{Binding TaskCollection}"
UseAutoUpdateHierarchy="False"
VisualStyle="Metro">
...
</sync:GanttControl> |
|
private void Gantt_Loaded(object sender, RoutedEventArgs e)
{
//To make the horizontal scrollbar visibility as collapsed.
FieldInfo fieldInfo = Gantt.GetType().GetField("ScheduleViewScrollViewer",BindingFlags.NonPublic | BindingFlags.Instance);
if (fieldInfo != null)
{
ScrollViewer scroller = fieldInfo.GetValue(Gantt) as ScrollViewer;
if (scroller != null)
{
scroller.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
}
}
} |
|
<gantt:GanttControl x:Name="Gantt"
ScheduleType="YearWithMonths"
StartTime="3/6/2019"
EndTime="10/7/2019"
ItemsSource="{Binding TaskDetails}"
VisualStyle="Metro">
</gantt:GanttControl> |
|
<gantt:GanttControl x:Name="Gantt"
ScheduleType="YearWithMonths"
ScheduleRangePadding="1"
ItemsSource="{Binding TaskDetails}"
VisualStyle="Metro">
</gantt:GanttControl> |
Hi,
the Suspect 2: Are expecting to remove right side whitespace is what we want to achieve.
We have just integrated the zoom factor with the slider, how we should modify that to achieve the goal.
I have also tried to set the endtime but the scroll bar did not work, i disablethe horizontal scrollbar, the scrolla bar you see reagrding gantt chart.
var sv2 = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(GanttChart, 0), 0) as ScrollViewer;
sv2.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
sv2.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
Best regards
Gian Piero Truccolo
|
private void Gantt_Loaded(object sender, RoutedEventArgs e)
{
GanttChart GanttChart = Gantt.FindElementOfType<GanttChart>();
//I WANT TO USE THIS SCROLLER
sv2 = VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(GanttChart, 0), 0) as ScrollViewer;
sv2.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
} |
|
private void Gantt_Loaded(object sender, RoutedEventArgs e)
{
…
FieldInfo fieldInfo = Gantt.GetType().GetField("ScheduleViewScrollViewer", BindingFlags.NonPublic | BindingFlags.Instance);
if (fieldInfo != null)
{
scroller = fieldInfo.GetValue(Gantt) as ScrollViewer;
if (scroller != null)
{
scroller.Style = null;
}
}
} |