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

How to change the back color in scheduler

5 Answers 185 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 27 Jan 2009, 09:57 AM

I am using scheduler control.

I have a dat list as follow to bind with control.

Count    Type        Date
2            Auto        27/01/2009
5            Manual    27/01/2009
4            Auto       28/01/2009
10         Manual    28/01/2009

1. I want to show count and Type with different bgcolor base on type.
2. I want to call dialog window when i click the day cell.

 

Please let me know how to change the color (or image) base on type and which event i need to use to call dialog?

One more thing i want to disable default insert, update and delete event since i just want to use this scheduler control for showing data.

Thanks,
Alex

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 27 Jan 2009, 12:10 PM
Hi Alex,

You can add Type as a Resource to the appointments and use the help topic to
Set different styles to appointments.

RadScheduler exposes OnClientAppointmentClick and OnClientTimeSlotClick which you can use to call a dialog on either appointment or time slot client click.


Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Alex
Top achievements
Rank 1
answered on 28 Jan 2009, 08:32 AM
Hi Peter,

Thanks for your reply. I can manage to bind the data and change the color.

But I am facing one problem when changing the background color. I use the following css to change the background and fore color of appointment. It is only change the fore color. I am using Office2007 skin. I think this skin over rule my css. Please let me know which property I do need to set. Thanks.

.FER

.rsAptOut

 

{

 

background: yellow;

 

 

color : Red;

 

}

.FERm

.rsAptOut

 

{

 

background: orange;

 

 

color : Green;

 

}


 

protected

void rdScheduler_AppointmentDataBound(object sender, SchedulerEventArgs e)

 

{

 

if (e.Appointment.Resources.GetResourceByType("Type") != null)

 

{

e.Appointment.CssClass = e.Appointment.Resources.GetResourceByType(

"Type").Text;

 

}

}

0
Peter
Telerik team
answered on 28 Jan 2009, 12:11 PM
Hi Alex,

Please, use "!important" to increase the specificity of the css selectors. For example:

.FER .rsAptOut 
 
{
    
background: yellow !important
    
color : Red
 }




Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Alex
Top achievements
Rank 1
answered on 29 Jan 2009, 02:15 AM
Hi Peter,

After I apply this css, my css does not work anymore. :) Please look my Scheduler tag.

.FER

.rsAptOut

 

 

 {

         

background: yellow !important;

 

         

color : Red;

 

}

 

 
<telerik:RadScheduler runat="server" ID="rdScheduler" Width="100%" Height="95%" ShowViewTabs="False" 
                         DataKeyField="ID" DataSubjectField="Subject" 
                         DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"   
                         SelectedView="MonthView" OnClientTimeSlotClick="OnClientTimeSlotClick"   
                         AllowDelete="False" AllowEdit="False" AllowInsert="False"   
                             EnableAdvancedForm="False" EnableResourceEditing="False"   
                         StartEditingInAdvancedForm="False"   
                         onappointmentdatabound="rdScheduler_AppointmentDataBound" Skin="Office2007" OverflowBehavior="Scroll">  
                           
 
                        <ResourceTypes> 
                            <telerik:ResourceType KeyField="ProcessLogID" ForeignKeyField="ProcessLogID" Name="ProcessType" TextField="ProcessType" /> 
                              
                        </ResourceTypes> 
                        </telerik:RadScheduler> 

0
Alex
Top achievements
Rank 1
answered on 29 Jan 2009, 02:45 AM
No worries. I can manage to change the color.

We need to use .rsAptWrap instead of .rsAptOut. Problem solved. thanks.
Tags
Scheduler
Asked by
Alex
Top achievements
Rank 1
Answers by
Peter
Telerik team
Alex
Top achievements
Rank 1
Share this question
or