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

Draw grid or day cell borders in a calendar with multiview

1 Answer 25 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Veteran
DoomerDGR8 asked on 08 Apr 2011, 09:53 AM
I require to have a grid drawn in the calendar. Or if every cell representing a day could haveits border ON will suffice as well. Kindly help. Regards.

1 Answer, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 08 Apr 2011, 11:39 AM
Hi Hassan,

Something like this should work for you

public partial class Form1 : Form
{
    private Padding padding = new Padding(1);
    public Form1()
    {
        InitializeComponent();
        this.radCalendar1.ElementRender += new Telerik.WinControls.UI.RenderElementEventHandler(this.radCalendar1_ElementRender);
        this.Shown += new EventHandler(Form1_Shown);
    }
    void Form1_Shown(object sender, EventArgs e)
    {
        this.radCalendar1.SelectedDate = DateTime.Today;
    }
    private void radCalendar1_ElementRender(object sender, Telerik.WinControls.UI.RenderElementEventArgs e)
    {
        e.Element.DrawBorder = true;
        e.Element.BorderColor = System.Drawing.Color.Gray;
    }
}

Hope that helps
Richard
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Richard Slade
Top achievements
Rank 2
Share this question
or