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

Appointment Icon

3 Answers 172 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Chris Scallion
Top achievements
Rank 1
Chris Scallion asked on 12 Jan 2011, 06:25 PM
We'd like to have the ability to add icon overlays to appointments. I don't see this functionality documented anywhere, so I assume that its not implemented directly. So my next question's would be:

Are appointments drawn using their own individual OnDraw() ? If so, where do I look to grab the drawing rectangle and graphics handle for an appointment object. 

If they are drawn on the schedule using the GDI graphics object of the scheduler grid, is there and accessible collection of rects for the current view, or would the control have to be extended manually. Obviously the latter option would be a last resort, since the layout logic would be a lot of work.

I know I could look at the source and find this out on my own, but where is the fun in that.

Thanks,
Chris

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 12 Jan 2011, 06:37 PM
Hi Chris,

Yes, you can add an appointment icon in the RadScheduler. You'll need to use the appointment formatting event. For exmaple
Private Sub RadScheduler1_AppointmentFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.SchedulerAppointmentEventArgs) Handles RadScheduler1.AppointmentFormatting
    ' if {condition} (e.g. e.Appointment.BackgroundId = 1 then
    e.AppointmentElement.Image = Image.FromFile("C:\Img.gif")
    e.AppointmentElement.ImageAlignment = ContentAlignment.MiddleLeft
End Sub

Hope that helps but let me know if you need more information
Richard
0
Chris Scallion
Top achievements
Rank 1
answered on 12 Jan 2011, 06:57 PM
Nice! Take $20 out of petty cash and tell em I said it was ok :-)

However, for anyone else looking for this info, it needs to be noted that setting:
e.AppointmentElement.ImageAlignment 

Will not give your the desired alignment unless you also set:
e.AppointmentElement.ImageLayout = ImageLayout.None

Which is apparently set to Center by default. On a side note, this AppointmentElement also exposes the drawing rectangle, so you can do what you want via GDI as well.

Again, thanks a bunch Richard!
0
Richard Slade
Top achievements
Rank 2
answered on 12 Jan 2011, 08:12 PM
No problem, Chris. Glad that helped.
($20 received from petty cash!) :o)
Regards
Richard
Tags
Scheduler and Reminder
Asked by
Chris Scallion
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Chris Scallion
Top achievements
Rank 1
Share this question
or