Hello, I have tried modifying https://docs.telerik.com/devtools/winforms/ganttview/timeline/custom-timeline to have it do custom ranges, however when I run my copy I get a fully blank header. See attached for images.
My setting the custom behavior:
radGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = start; // Start is a DateTime
radGanttView1.GanttViewElement.GraphicalViewElement.TimelineEnd = end; // End is a DateTime
127.returnstring.Format(System.Threading.Thread.CurrentThread.CurrentCulture, format, newDateTime(item.Start.Minute + index, 1, 1));
3 Answers, 1 is accepted
answered on 18 Sep 2018, 08:11 AM
Thank you for writing.
It will be necessary to apply the custom timeline behavior to the Gantt View before setting the TimelineStart and TimelineEnd properties. I also noticed that you might also create an invalid DateTime object in the GetTimelineBottomElementText method in the custom class, you can consider changing the format. To test this I have also increased the OnePixelTime property:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
this.radGanttView1.Ratio = 0.35f;
DateTime start = new DateTime(2010, 10, 10, 10, 0, 0);
Thanks, I will be giving that a try this week. Also, is it possible to change behaviors on the fly? Ie if I had a trackbar for zooming, start limiting how many items are shown in the time line as you zoom out?
answered on 19 Sep 2018, 06:19 AM
Yes, that would be possible, however, it should be handled manually. Once you change the zoom level in the control and depending on your actual scenario and data you may want to assign a different timeline behavior class. In order to have the new timeline applied at run-time, it will be necessary to update the layout and recreate the task and the links. This can be achieved by changing the TimelineRange to any of the default ranges, e.g. like this: