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

RadScheduler Appointment dynamic display

3 Answers 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tofan
Top achievements
Rank 1
Tofan asked on 28 Jan 2014, 12:44 PM
I have a scheduler in my asp page. When the appointments are displayed I want to display for some appointments all my items in the AppointmentTemplate and in others only the appointment subject? Can it be done?

My code is:

<telerik:RadScheduler ID="SchProgramariEchipament" runat="server" DataDescriptionField="DESCRIERE"
                    DataEndField="DATA_END" DataKeyField="ID" DataSourceID="dsProgramareEchipament" DataStartField="DATA_START"
                    DataSubjectField="SUBIECT" Skin="Windows7" StartInsertingInAdvancedForm="True" OnAppointmentCancelingEdit="SchProgramariEchipament_AppointmentCancelingEdit"
                    AppointmentStyleMode="Default" OnAppointmentInsert="SchProgramariEchipament_AppointmentInsert"
                    OnAppointmentUpdate="SchProgramariEchipament_AppointmentUpdate" OnAppointmentDelete="SchProgramariEchipament_AppointmentDelete"
                    OnAppointmentDataBound="SchProgramariEchipament_AppointmentDataBound" OnFormCreated="SchProgramariEchipament_FormCreated"
                    EditFormDateFormat="dd/MM/yyyy" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableExactTimeRendering="true"
                    CustomAttributeNames="id_aparatura" OverflowBehavior="Auto">
                    <Localization AdvancedNewAppointment="Programare Echipament Nou" AdvancedSubject="Subiect"
                        ConfirmDeleteText="Vrei sa stergeti programarea?" ConfirmDeleteTitle="Vreti sa stergeti programarea?" 
                        ConfirmOK="Da" ConfirmCancel="Nu"
                        HeaderDay="Zi" HeaderMonth="Luna" HeaderToday="Azi" HeaderWeek="Saptamana" Save="Salvare"
                        Cancel="Anuleaza" Show24Hours="24 ore..." ShowBusinessHours="Perioada de Serviciu" />
                    <AdvancedForm Modal="false"></AdvancedForm>
                    <AdvancedForm DateFormat="dd/MM/yyyy" />
                    <ExportSettings OpenInNewWindow="True">
                    </ExportSettings>
                    <ResourceTypes>
                        <telerik:ResourceType KeyField="id_sala" Name="Sala" TextField="nume"
                            ForeignKeyField="id_sala" DataSourceID="dsSala" AllowMultipleValues="false">
                        </telerik:ResourceType>
                        <telerik:ResourceType KeyField="ID_OPERATIE" Name="Operatie" TextField="denumire"
                            ForeignKeyField="ID_OPERATIE" DataSourceID="dsOperatie" AllowMultipleValues="false">
                        </telerik:ResourceType>
                    <telerik:ResourceType  KeyField="ID_OPERATIE" Name="Protocol" TextField="nume_protocol" ForeignKeyField="ID_OPERATIE"
                        DataSourceID="dsProtocol" AllowMultipleValues="false"  >
                    </telerik:ResourceType>
                    </ResourceTypes>
                    <ResourceStyles>
                    </ResourceStyles>
                    <AppointmentTemplate>
                        <div style="font-style: italic; width:100%">
                            Subiect:
                            <%# Eval("Subject") %></div>
                        <div style="font-style: italic; width:100%">
                            Sala Operatie:
                            <%# Eval("Sala.Text")%></div>
                        <div style="font-style: italic; width:100%">
                            Operatie:
                            <%# Eval("Operatie.Text")%></div>
                    </AppointmentTemplate>
                    <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
                </telerik:RadScheduler>
                <asp:SqlDataSource ID="dsProgramareEchipament" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    DeleteCommand="DELETE FROM PROGRAMARE_ECHIPAMENT WHERE ID=:original_ID" OldValuesParameterFormatString="original_{0}"
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT ID,ID_ECHIPAMENT,SUBIECT,DESCRIERE,DATA_START,DATA_END,E_PERIOADA_STERILIZARE,ID_OPERATIE,ID_SALA FROM PROGRAMARE_ECHIPAMENT where ID_ECHIPAMENT=:ID_ECHIPAMENT"
                    OnSelecting="dsProgramareEchipament_OnSelecting">
                    <DeleteParameters>
                        <asp:Parameter Name="original_ID" Type="Decimal" />
                    </DeleteParameters>
                    <SelectParameters>
                        <asp:Parameter Name="ID_ECHIPAMENT" Type="Decimal" />
                    </SelectParameters>
                </asp:SqlDataSource>                                                                                                                                                                                                                                         So for some appointments I want to display Subiect/Sala Operatie/Operatie and from others I want to only display only Subject. The condition that tells me what type of appointment is from a result of storedprocedure called from code behind. Please help me. Thanks.
                  




3 Answers, 1 is accepted

Sort by
0
Tofan
Top achievements
Rank 1
answered on 31 Jan 2014, 12:32 PM
Is what I asked possible and if so how? Please help.
0
Accepted
Plamen
Telerik team
answered on 31 Jan 2014, 12:55 PM
Hello,

You can use AppointmentCreated event for this and hide some of the controls in the particular appointment container.

Hope this will help you solve the issue.

Regards,
Plamen
Telerik
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 UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Tofan
Top achievements
Rank 1
answered on 31 Jan 2014, 02:11 PM
thanks. It solved my problem.
Tags
Scheduler
Asked by
Tofan
Top achievements
Rank 1
Answers by
Tofan
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or