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

Appointment width

1 Answer 59 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Franco
Top achievements
Rank 1
Franco asked on 21 Mar 2011, 10:37 AM
Good morning.
Is it possible to set the width of an appointment? My problem is to leave a space on the right of existing appointments to make it easy to select cells for creating a new appointment.
Thank you
Gianfranco Pesenato

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Todorov
Telerik team
answered on 23 Mar 2011, 04:27 PM
Hi Franco,

You can set a margin to the appointment element in order to leave space on the right. To do so, you
have two options. The first one is to edit the theme you are using and set the AppointmentMargin properties of all views of the RadScheduler. General help on using Visual Style Builder can be found here.
I have attached some screenshots which show where you can find the AppointmentMargin property.

The second option is to subscribe to the ActiveViewChanged event and set the AppointmentMargin property. Here is a code snippet that demonstrates this:

public Form1()
{
    InitializeComponent();
    radScheduler1.ActiveViewChanged += new EventHandler<SchedulerViewChangedEventArgs>(radScheduler1_ActiveViewChanged);
    SetAppointmentsMargin();
}
 
void radScheduler1_ActiveViewChanged(object sender, SchedulerViewChangedEventArgs e)
{
    SetAppointmentsMargin();
}
 
void SetAppointmentsMargin()
{
    SchedulerTimelineViewElement timelineElement = (radScheduler1.SchedulerElement.ViewElement as SchedulerTimelineViewElement);
 
    if (timelineElement != null)
    {
        timelineElement.AppointmentMargin = new Padding(3, 0, 30, 0);
        return;
    }
 
    SchedulerDayViewElement dayviewElement = (radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewElement);
 
    if (dayviewElement != null)
    {
        dayviewElement.AppointmentMargin = new Padding(3, 0, 30, 0);
        return;
    }
 
    SchedulerMonthViewElement monthviewElement = (radScheduler1.SchedulerElement.ViewElement as SchedulerMonthViewElement);
 
    if (monthviewElement != null)
    {
        monthviewElement.AppointmentMargin = new Padding(3, 0, 30, 0);
        return;
    }
}

I hope this helps. Feel free to ask if you have any other questions.

Greetings,
Ivan Todorov
the Telerik team
Tags
Scheduler and Reminder
Asked by
Franco
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or