We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Data Range

How can I define a visible date range for the Gantt control?
If I add a task from 06/03/2019 to 10/08/2019, I´m getting the full 2019 year and 2 months of 2020 on the gantt grid.
Thanks in advance.

3 Replies

VR Vignesh Ramesh Syncfusion Team October 22, 2019 06:40 AM UTC

Hi Sérgio,   
   
Greetings from Syncfusion.   
   
We have analyzed your requirement and we would like to inform you that GanttControl has support to specify the schedule range, by using StartTime and EndTime properties. You can specify the schedule range as per the below code snippet.    
   
[XAML]: 
<!--  Gantt Control Information  --> 
<gantt:GanttControl x:Name="Gantt" 
                    ScheduleType="YearWithMonths" 
                    StartTime="3/6/2019" 
                    EndTime="10/8/2019" 
                    ItemsSource="{Binding TaskDetails}" 
                    VisualStyle="Metro"> 
</gantt:GanttControl> 
   
Also, GanttControl have support to specify the schedule range padding. By using ScheduleRangePadding property you can specify the padding for gantt chart. Please find the code snippet as below   
   
[XAML]: 
<!--  Gantt Control Information  --> 
<gantt:GanttControl x:Name="Gantt" 
                    ScheduleType="YearWithMonths" 
                    ScheduleRangePadding="1" 
                    ItemsSource="{Binding TaskDetails}" 
                    VisualStyle="Metro"> 
</gantt:GanttControl> 
   
NOTE: If bottom schedule unit is Month, 1 month added front and back of the schedule.   
   
Please find the sample from the below link. 

Please let us know if you have any queries.    
   
Regards,   
Vignesh. 



SR Sérgio Rodrigues Costa October 22, 2019 07:35 PM UTC

Thanks a lot!


RA Rachel A Syncfusion Team October 23, 2019 05:35 AM UTC

Hi Sérgio, 
 
Thanks for the response. 
 
Please let us know if you need any further assistance. 
 
Thanks, 
Rachel. 


Loader.
Live Chat Icon For mobile
Up arrow icon