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

How to increase numbers font size in the calendar control

3 Answers 818 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Veshala
Top achievements
Rank 1
Veshala asked on 03 Aug 2009, 08:47 PM
Hi,

We are in the process of increasing the font size for all controls within our windows application.
I could not figure out how to increase the numbers font size in the Calendar control.

Thanks
Vanitha

3 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 04 Aug 2009, 08:24 AM
Hello Veshala,

Thank you for writing. Here is a sample code which demonstrates how to modify the Font property of RadCalendar cells:

     RadCalendarElement calendarElement = this.radCalendar1.CalendarElement;
            MonthViewElement monthViewElement = (MonthViewElement)calendarElement.CalendarVisualElement;
            CalendarTableElement table =monthViewElement.TableElement;
            foreach(CalendarCellElement cell in table.Children )
            {
                cell.Font = new Font(cell.Font, FontStyle.Bold);
            }

You can also modify any other properties of CalendarCellElement such as BackColor, ForeColor. You can also find the cell position in the calendar table using the Row and Column properties.

To check whether a specific cell is a header cell i.e a cell from the Row header or Column header you can do the following:

       bool isHeaderCell = (bool)cell.GetValue(CalendarCellElement.IsHeaderCellProperty);

Please write me back if you need more information.

Best wishes,
Boyko Markov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mike
Top achievements
Rank 1
answered on 22 Jul 2015, 08:38 PM

i've tried this, and am using the zoom header navigation mode... whenever i use the zoom navigation i lose the font settings for the calendar items, is there an event i need to refresh the font settings on, or could there be a global way of overriding the font so i dont have to set it for every single cell?

 

also is there any way to make the fastforward, fastreverse, next and previous arrows larger on the calendar header?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 Jul 2015, 09:55 AM
Hello Mike,

Thank you for writing.

In order to change the font of RadCalendar cell elements it is appropriate to use the RadCalendar.ElementRender event:
Font f = new Font("Arial", 12f, FontStyle.Bold);
 
private void radCalendar1_ElementRender(object sender, Telerik.WinControls.UI.RenderElementEventArgs e)
{
    e.Element.Font = f;
}

As to the question about customizing the header elements, you can access each item from the CalendarElement.CalendarNavigationElement and specifies the desired MinSize:
this.radCalendar1.CalendarElement.CalendarNavigationElement.NextButton.MinSize = new Size(50, 30);

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Veshala
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Mike
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or