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

Display Additional Columns from SQL table on top Of a Rad scheduler cell

2 Answers 62 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
smith spd
Top achievements
Rank 1
smith spd asked on 07 Jun 2010, 07:04 PM

Hello Telerik Team,

I have a requirement where i need to bind the scheduler to a sql database table and display some columns
from the table on top of the cell.I mean by default scheduler just shows up the subject on the cell but i wanted to display some additional columns from database example priority column, Description column,etc on top of each cell instead of the edit template.At the same time i need to colour code the cell based on the status column values.

I have connected the scheduler to sql datasource already and able to fetch the information.

Any pointers in this direction are greatly appreciated.

Thank you
Smith

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 08 Jun 2010, 09:06 AM
Hi smith,

You can display any extra information about an appointment using AppointmentTemplate as shown in the following demos: Using Templates and Resource Availability.

Greetings,
Peter
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
smith spd
Top achievements
Rank 1
answered on 08 Jun 2010, 08:07 PM
Thank you Telerik Team,

I found the reference you showed me as useful.
I was able to show the coulmns from the database table on top of my rad scheduler cell by using

<

 

AppointmentTemplate>

 

 

 

<b>Subject:</b><%#Eval("Subject") %>

 

 

 

<br />

 

 

 

<b>STATUS:</b><%#Eval("STATUS")%>

 

 

</AppointmentTemplate>
in my ascx.

 

 

 

 

 


I used the above snippet to do it.
I was able to colour code the appointment based on the status using

 

protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)

 

{

 

 

if (e.Appointment.Attributes["STATUS"] == "Approved")

 

{

e.Appointment.BackColor = System.Drawing.

 

Color.Red;

 

}

 

 

else if (e.Appointment.Attributes["STATUS"] == "Pending")

 

{

e.Appointment.BackColor = System.Drawing.

 

Color.Green;

 

}

 

 

else

 

 

{

e.Appointment.BackColor = System.Drawing.

Color.Turquoise;

 

}

 

}

here the "STATUS" is the exact column name of the database table.

Thank you For your support.

Smith

 

Tags
Scheduler
Asked by
smith spd
Top achievements
Rank 1
Answers by
Peter
Telerik team
smith spd
Top achievements
Rank 1
Share this question
or