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

Give resource a color that is comming from Entity Data Source

1 Answer 31 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 26 Mar 2016, 04:00 PM

I am loading dynamic resources from and entity data source but I wish to give them an individual color  how do i map a resource style dyanmcially

 

01.<asp:UpdatePanel ID="UpdatePanel1" runat="server">
02.         <ContentTemplate>
03.                         <telerik:RadScheduler OnTimeSlotCreated="apertureAppointments_TimeSlotCreated"   OverflowBehavior="Auto" runat="server" WeekView-ShowDateHeaders="true"  EnableResize="false" ID="apertureAppointments"
04.                             TimelineView-UserSelectable="false" DayView-UserSelectable="true" AgendaView-UserSelectable="True" DataKeyField="ID" DataSubjectField="Subject" AllowInsert="false" AllowDelete="false" AllowEdit="false"
05.                             DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule" DayView-EnableExactTimeRendering="true"  WeekView-UserSelectable="True"
06.                             DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="EntityDataSource1" StartInsertingInAdvancedForm="True"  MonthView-UserSelectable="True" AgendaView-NumberOfDays="5"
07.                            RenderMode="Classic" EnableExactTimeRendering="True"  
08.                             DayStartTime="09:00:00" ShowFooter="false" DayEndTime="18:00"  FirstDayOfWeek="Monday" LastDayOfWeek="Friday" HoursPanelTimeFormat="HH:mm tt" MinutesPerRow="30" TimeLabelRowSpan="2"  OnAppointmentClick="apertureAppointments_AppointmentClick" OnTimeSlotContextMenuItemClicking="apertureAppointments_TimeSlotContextMenuItemClicking"
09.                             EnableDescriptionField="true" AppointmentStyleMode="Default" Skin="Metro"
10.                             >
11. 
12.                             <ExportSettings OpenInNewWindow="True">
13.                                 <Pdf PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" />
14.                             </ExportSettings>
15.                             <AdvancedForm Modal="True" />
16. 
17.                             <TimeSlotContextMenuSettings EnableDefault="false" />
18.                             <AppointmentContextMenuSettings EnableDefault="false" />
19.                             <DayView EnableExactTimeRendering="True" />
20. 
21.                             <ResourceTypes>
22.                                 <telerik:ResourceType KeyField="lookup_code" Name="Managers" TextField="lookup_description" ForeignKeyField="managerId"
23.                                     DataSourceID="ManagersDataSource"></telerik:ResourceType>
24.                             </ResourceTypes>
25.                         </telerik:RadScheduler>            </ContentTemplate>
26.                     </asp:UpdatePanel>
27.                  
28.                     <asp:EntityDataSource runat="server" ID="EntityDataSource1" ConnectionString="name=aperturenetEntities"
29.                         DefaultContainerName="aperturenetEntities" EntitySetName="Appointments" EnableDelete="true"
30.                         EnableInsert="true" EnableUpdate="true">
31.                     </asp:EntityDataSource>
32. 
33.                     <asp:SqlDataSource ID="RoomsDataSource" runat="server"
34.                         ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:aperturenetSql %>"
35.                         SelectCommand="SELECT * FROM [Rooms]"></asp:SqlDataSource>
36. 
37.                     <asp:SqlDataSource ID="ManagersDataSource" runat="server"
38.                         ConnectionString="<%$ ConnectionStrings:aperturenetSql %>" SelectCommand="SELECT * FROM [tblApertureNetLookUps] WHERE lookup_type='11787CA6-DE99-4E0E-83D2-7D96E0FD11A3'"></asp:SqlDataSource>

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 30 Mar 2016, 12:46 PM
Hi,

You can use the AppointmentDataBound event to get the appointment , its resource and to add backColor or CssClass to the appointment so that it changes its color.

Regards,
Plamen
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Scheduler
Asked by
Philip
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or