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

Appointment as solid green bar?

5 Answers 68 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Lou
Top achievements
Rank 1
Lou asked on 22 Oct 2014, 10:10 PM
Hi,

Is there a way to make an appointment on the calendar appear as a simple solid green bar (rectangle)?

The rectangle needs to start exactly at the event start time and end at the end time and ideally be without any type of fancy shading/background (just a plain rectangle). Ideally, the width of the rectangle would cover the whole width of the cell (assuming no other appointments overlapping the same time period).

Thanks,

-Lou

5 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 23 Oct 2014, 08:03 AM
Hi Lou,

Thank you for writing.

You can use the AppontmentFormatting event to change the appearance of the AppointmentElements:
void radScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    e.AppointmentElement.DrawFill = true;
    e.AppointmentElement.BackColor = Color.Green;
    e.AppointmentElement.GradientStyle = GradientStyles.Solid;
}

More information about this event can be found here: http://www.telerik.com/help/winforms/scheduler-appearance-formatting-appointments.html.

I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Lou
Top achievements
Rank 1
answered on 23 Oct 2014, 01:08 PM
Thanks Stefan, I will try this.
0
Lou
Top achievements
Rank 1
answered on 23 Oct 2014, 03:25 PM
Hi,

I am close to what I need but not quite there yet, I could use a little more help if possible.

I now have the following settings for the appointmentElement:
 
    appointmentElement.DrawFill = True
    appointmentElement.BackColor = Color.Green
    appointmentElement.GradientStyle = GradientStyles.Solid
    appointmentElement.BorderWidth = 0
    appointmentElement.Padding = New Padding(0)
    appointmentElement.Margin = New Padding(0)

This is quite close to what I need except for the following (see screen shot)

1. There is a white/blue border on the left hand side next to the green bar.
2. The bar doesn't *quite* come to the end time. It's just before the end time (which is 8am). Can I make it come all the way to 8am?
3. The bar needs to be the same width as the column (fill the entire horizontal space for the day, or as much as possible).

How can I fix this? Thanks again for the help.

-Lou

0
Stefan
Telerik team
answered on 28 Oct 2014, 09:56 AM
Hi Lou,

Thank you for writing back.

Straight to your questions:

1. The line you are referring to is the status of the appointment. By setting the UseDefaultPaint to true will not draw it.
2. I believe this is handled by the above setting as well. If not, you can have a look at the exact time rendering functionality.
3. This can be regulated via the AppointmentMargin property of the view element. A suitable place to introduce this setting is the ActiveViewChanged event.

Here is a code snippet of the changes:
Private Sub radScheduler1_ActiveViewChanged(sender As Object, e As SchedulerViewChangedEventArgs)
    If TypeOf e.NewView Is SchedulerWeekView Then
        TryCast(radScheduler1.ViewElement, SchedulerDayViewElement).AppointmentMargin = New Padding(0)
    End If
End Sub
 
Private Sub radScheduler1_AppointmentFormatting(sender As Object, e As SchedulerAppointmentEventArgs)
    e.AppointmentElement.DrawFill = True
    e.AppointmentElement.BackColor = Color.Green
    e.AppointmentElement.GradientStyle = GradientStyles.Solid
    e.AppointmentElement.BorderWidth = 0
    e.AppointmentElement.UseDefaultPaint = True
End Sub

I hope that you find this information useful.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Lou
Top achievements
Rank 1
answered on 28 Oct 2014, 07:30 PM
Hi Stefan, thanks for the response I will try your suggestions.

-Lou
Tags
Scheduler and Reminder
Asked by
Lou
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Lou
Top achievements
Rank 1
Share this question
or