Im having some trouble with the ruler text format. The zeroes always gets overlapped with the hours and I can't figure out how to change it. I tried setting the RulerWidth property, but that didn't work. Screenshot is attached.
Thank you,
2 Answers, 1 is accepted
0
Boyko Markov
Telerik team
answered on 05 May 2010, 11:36 AM
Hello Daniel Lindberg,
Did you set any Font properties to the Scheduler control? What dpi settings do you use in your PC?
Another solution is to override the default rendering of the Ruler. You can achieve this by doing the following:
1. Set the RulerRenderer property of the RulerPrimitive:
SchedulerDayViewElement dayView =
this.radScheduler.SchedulerElement.ViewElement as SchedulerDayViewElement;
dayView.DataAreaElement.Ruler.RulerRenderer = new
MyRulerRenderer(dayView.DataAreaElement.Ruler);
2. Create a custom RulerRenderer class which will be set to the RulerPrimitive:
public class MyRulerRenderer : RulerRenderer
{
public MyRulerRenderer(RulerPrimitive ruler)
: base(ruler)
{
}
public override void RenderHour(Telerik.WinControls.Paint.IGraphics g, int hour, Rectangle bounds)
{
g.DrawString(hour.ToString(), bounds, new Font(FontFamily.GenericSerif, 8.25f, FontStyle.Regular),
Color.Black, ContentAlignment.MiddleCenter, new StringFormat(), Orientation.Horizontal, false);
}
}
Do not hesitate to contact us, if you have more questions.
All the best,
Boyko Markov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.