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

AppointmentDataBound & Icone

7 Answers 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jean-Yves
Top achievements
Rank 1
Jean-Yves asked on 13 Oct 2010, 10:11 AM
Hi, 

It's really simple, in a RadScheduler, in the methode AppointmentDataBound is it possible to add an icone before the text?

I done this for example : 
e.Appointment.Font.Bold = true;
e.Appointment.ForeColor = Color.Green;

But I would like to put an icone at the same time.

Thank you

7 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 13 Oct 2010, 02:14 PM
Hi Jean-Yves,

You will not be able to add icon in the AppoinmentDataBound event.

You'll need to use an AppointmentTemplate to be able to set an icon before the text of the Appointment. Please take a look at this demo about "Using Templates" for reference.

Please feel free to ask me if you have further questions.

Best wishes,
Veronica Milcheva
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Jean-Yves
Top achievements
Rank 1
answered on 14 Oct 2010, 06:55 AM
Hello, 

Thank you for the anwser.
Yes, I will have to do like this...

Just, I think that it can ba a great feature that you can be able to findcontrol of appointmentTemplate in the AppointmentDataBound.

Anyway, Thank you

Jean-Yves
0
Veronica
Telerik team
answered on 14 Oct 2010, 08:14 AM
Hi Jean-Yves,

You are able to find controls in the appointment template in OnAppointmentDataBound event using the FindControl(). However after finding the control - you only can change the properties of existing controls in the template - for example change the text of the Subject. You are not be able to add new controls to the appointment in AppointmentDataBound handler.

All the best,
Veronica MIlcheva
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Sandy
Top achievements
Rank 1
answered on 05 Mar 2012, 04:22 PM
Hi,
How can I access the Control properties in Appointment Databound.
I want to disable the linkbutton cotrol in one condition how can I disable that in Appointment databound Event.

Thank you very much.
0
Peter
Telerik team
answered on 05 Mar 2012, 04:30 PM
Hi Sandy,

This can be done by handling AppointmentCreated as shown in this online demo.
protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            if (e.Appointment.RecurrenceState == RecurrenceState.Master || e.Appointment.RecurrenceState == RecurrenceState.Occurrence)
            {
                Panel recurrenceStatePanel = e.Container.FindControl("RecurrencePanel") as Panel;
                recurrenceStatePanel.Visible = true;
            }
            if (e.Appointment.RecurrenceState == RecurrenceState.Exception)
            {
                Panel recurrenceExceptionPanel = e.Container.FindControl("RecurrenceExceptionPanel") as Panel;
                recurrenceExceptionPanel.Visible = true;
            }
            if (e.Appointment.Reminders.Count != 0)
            {
                Panel reminderPanel = e.Container.FindControl("ReminderPanel") as Panel;
                reminderPanel.Visible = true;
            }
        }



Kind regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Sandy
Top achievements
Rank 1
answered on 05 Mar 2012, 05:08 PM
Thank you for your response,

But I want to access that control only after binding.I am not creating any appointments. I am just binding the appointments which are in my database.
If I use appointment created event. I am unable to get the DataItem.
I am failing at this step.

AppointmentVWDTO appt = e.Appointment.DataItem as AppointmentVWDTO
0
Peter
Telerik team
answered on 06 Mar 2012, 03:41 PM
Hi Sandy,

There is a similar discussion with some suggested workarounds in this forum thread. I hope you find it helpful.

Greetings,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Jean-Yves
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Jean-Yves
Top achievements
Rank 1
Sandy
Top achievements
Rank 1
Peter
Telerik team
Share this question
or