This is a migrated thread and some comments may be shown as answers.

Ruler text problem

2 Answers 66 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Daniel Lindberg
Top achievements
Rank 1
Daniel Lindberg asked on 03 May 2010, 11:04 AM
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

Sort by
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.
0
Daniel Lindberg
Top achievements
Rank 1
answered on 05 May 2010, 12:37 PM
Using the custom render solved my problems. Thank you very much for your help!

Regards,
Daniel Lindberg
Tags
Scheduler and Reminder
Asked by
Daniel Lindberg
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Daniel Lindberg
Top achievements
Rank 1
Share this question
or