Hi Zander,
Thank you for reporting this. As a workaround, we can add additional checks in the MeasureOverride and ArrangeOveride methods of the GanttViewTimelineItemBottomStackElement.
public class CustomGanttViewTimelineElementProvider : GanttViewTimelineElementProvider
{
public CustomGanttViewTimelineElementProvider(GanttViewGraphicalViewElement owner) : base(owner)
{
}
public override IVirtualizedElement<GanttViewTimelineDataItem> CreateElement(GanttViewTimelineDataItem data, object context)
{
GanttViewTimelineItemElement element = this.OnItemElementCreating(data);
return new CustomGanttViewTimelineItemElement(data, Owner);
}
}
public class CustomGanttViewTimelineItemElement : GanttViewTimelineItemElement
{
public CustomGanttViewTimelineItemElement(GanttViewTimelineDataItem data, GanttViewGraphicalViewElement graphicalViewElement) : base(data, graphicalViewElement)
{
}
public override GanttViewTimelineItemBottomStackElement CreateTimelineItemBottomStackElement()
{
return new CustomGanttViewTimelineItemBottomStackElement();
}
}
public class CustomGanttViewTimelineItemBottomStackElement : GanttViewTimelineItemBottomStackElement
{
public CustomGanttViewTimelineItemBottomStackElement() : base()
{
}
protected override SizeF MeasureOverride(SizeF availableSize)
{
if (this.Children.Count == 0)
{
return availableSize;
}
return base.MeasureOverride(availableSize);
}
protected override SizeF ArrangeOverride(SizeF finalSize)
{
if (this.Children.Count == 0)
{
return finalSize;
}
return base.ArrangeOverride(finalSize);
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.radGanttView1.GanttViewElement.GraphicalViewElement.TimelineContainer.ElementProvider = new CustomGanttViewTimelineElementProvider(this.radGanttView1.GanttViewElement.GraphicalViewElement);
this.radGanttView1.DataProvider = new GanttViewIntegrationProvider(this.radScheduler1);
}
It will be better to change the ElementProvider before populating the RadGanttView control with data.
Regards,
Dinko | Tech Support Engineer
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.