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

Changing text in radscheduler print

1 Answer 86 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
JJ
Top achievements
Rank 1
JJ asked on 13 May 2012, 02:14 AM
I am starting to use the radscheduler for one of my company's project.  I would like to change the text in the print for the appointment. I tried to change the appointment.text in the event CellPrintElementFormating without any success.  Is there a way to accomplish it?

Thanks
JJ

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 15 May 2012, 12:33 PM
Hello JJ,

Thank you for writing.

Not being able to change the appointments' text in the AppointmentPrintElementFormatting event is a known limitation and it will be improved with the next official release. For the time being, you can print custom text in your appointments by using the following approach:
public Form1()
{
    InitializeComponent();
    this.radScheduler1.AppointmentPrintElementFormatting += new PrintAppointmentEventHandler(radScheduler1_AppointmentPrintElementFormatting);
    this.radScheduler1.AppointmentPrintElementPaint += new PrintAppointmentPaintEventHandler(radScheduler1_AppointmentPrintElementPaint);
}
 
void radScheduler1_AppointmentPrintElementPaint(object sender, PrintAppointmentPaintEventArgs e)
{
    Rectangle rect = e.Bounds;
    rect.Offset(e.AppointmentElement.StatusAreaWidth, 0);
    rect.Width -= e.AppointmentElement.StatusAreaWidth;
 
    string text = "The summary is " + e.AppointmentElement.Appointment.Summary;
    using(Brush brush = new SolidBrush(e.AppointmentElement.ForeColor))
    {
        e.Graphics.DrawString(text, e.AppointmentElement.Font, brush, rect);
    }
}
 
void radScheduler1_AppointmentPrintElementFormatting(object sender, PrintAppointmentEventArgs e)
{
    e.AppointmentElement.DrawText = false;
}

I hope you find this useful. If you have any further questions, feel free to ask.

Kind regards,
Ivan Todorov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
Scheduler and Reminder
Asked by
JJ
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or