Gantt Chart Month and Week Time interval not in synk.

1 Answer 124 Views
GanttView
Dhiraj
Top achievements
Rank 1
Dhiraj asked on 12 Jul 2021, 11:56 AM

The Week is started at the start of the month but not ended at end of the month.
Is it possible to do it? 

 

Code :

        <telerik:RadGanttView x:Name="ganttView" TasksSource="{Binding Tasks}" VisibleRange="{Binding VisibleRange}">
            <telerik:RadGanttView.TimeRulerLines>
                <telerik:GroupTickLine>
                    <telerik:TickInterval Interval="OneMonth" />
                </telerik:GroupTickLine>
                <telerik:GroupTickLine>
                    <local:WeekTickInterval Interval="OneWeek" />
                </telerik:GroupTickLine>
                <telerik:MajorTickLine>
                    <telerik:TickInterval Interval="OneDay"  />
                </telerik:MajorTickLine>
            </telerik:RadGanttView.TimeRulerLines>
            <telerik:RadGanttView.Columns>
                <telerik:TreeColumnDefinition Header="Project" Width="AutoHeaderAndContent" MinWidth="200"/>
            </telerik:RadGanttView.Columns>
        </telerik:RadGanttView>

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 15 Jul 2021, 12:38 PM

Hello Dhjiraj,

To achieve your requirement, you can create a custom tick interval and override its GetNext() method. I can see you are already creating a custom week interval (WeekTickInterval) where you can incorporate this logic. Basically, in the method override, you can check if the week enters the next month. In this case, you can remove the days in the next month from the return DateTime object.

protected override DateTime GetNext(DateTime dateTime)
{
	DateTime date = base.GetNext(dateTime);
	// here you can alter the date
	return date;
}

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GanttView
Asked by
Dhiraj
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or