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

Scheduler

1 Answer 46 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Bhanu Prakash
Top achievements
Rank 1
Bhanu Prakash asked on 27 Jul 2010, 11:06 AM
Hi,

  Iam using radschduler. Iam saving the details description,start,end.But how can i differntiate it is personal or work. Iam using checboxes to differentiate personal and work. BUt how can i insert in to the database these checkbox values.Below is my sample code.
I want to insert the Appoinment as personal or WOrk or both . Later I want to display based on the values of checkboxes. Please give me the solution as soons as possible.


    <div class="title">
                Schedule</div>
            <telerik:RadSplitter runat="server" ID="RadSplitter1" PanesBorderSize="0" Width="734px"
                Height="552px" Skin="Office2007" SplitBarsSize="">
                <telerik:RadPane runat="Server" ID="leftPane" Width="240px" MinWidth="240" MaxWidth="300"
                    Scrolling="None" OnClientResizing="hideScrollableArea" OnClientResized="showScrollableArea"
                    OnClientExpanding="hideScrollableArea" OnClientExpanded="showScrollableArea"
                    OnClientCollapsing="hideScrollableArea" OnClientCollapsed="showScrollableArea">
                    <div class="calendar-container">
                        <telerik:RadCalendar runat="server" ID="RadCalendar1" Skin="Office2007" AutoPostBack="True"
                            EnableMultiSelect="False" DayNameFormat="FirstTwoLetters" EnableMonthYearFastNavigation="False"
                            OnSelectionChanged="RadCalendar1_SelectionChanged" OnDefaultViewChanged="RadCalendar1_DefaultViewChanged"
                            SelectedDate="" ViewSelectorText="x">
                            <SpecialDays>
                                <telerik:RadCalendarDay Date="" IsToday="True">
                                </telerik:RadCalendarDay>
                            </SpecialDays>
                        </telerik:RadCalendar>
                        <telerik:RadCalendar runat="server" ID="RadCalendar2" Skin="Office2007" AutoPostBack="true"
                            EnableMultiSelect="false" DayNameFormat="FirstTwoLetters" EnableNavigation="false"
                            EnableMonthYearFastNavigation="false" OnSelectionChanged="RadCalendar2_SelectionChanged">
                        </telerik:RadCalendar>
                    </div>
                    <telerik:RadPanelBar runat="server" Skin="Office2007" ID="PanelBar" Width="100%">
                        <Items>
                            <telerik:RadPanelItem runat="server" Text="To Do" Expanded="true">
                                <Items>
                                    <telerik:RadPanelItem runat="server">
                                        <ItemTemplate>
                                          
                                        </ItemTemplate>
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                            <telerik:RadPanelItem runat="server" Text="My Calendar" Expanded="true">
                                <Items>
                                    <telerik:RadPanelItem runat="server">
                                        <ItemTemplate>
                                            <div class="rpCheckBoxPanel">
                                                <div>
                                                    <asp:CheckBox ID="chkQ1" runat="server" Text="Personal" Checked="true" AutoPostBack="true"
                                                        OnCheckedChanged="CheckBoxes_CheckedChanged" />
                                                </div>
                                                <div>
                                                    <asp:CheckBox ID="chkQ2" runat="server" Text="Work" Checked="true" AutoPostBack="true"
                                                        OnCheckedChanged="CheckBoxes_CheckedChanged" />
                                                </div>
                                            </div>
                                        </ItemTemplate>
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelBar>
                </telerik:RadPane>
                <telerik:RadSplitBar runat="server" ID="RadSplitBar2" CollapseMode="Forward" />
                <telerik:RadPane runat="Server" ID="rightPane" Scrolling="None" Width="490px">
                    <telerik:RadScheduler runat="server" ID="RadScheduler" Skin="Office2007" DataSourceID="UsersSqlDataSource"
                        Height="551px" ShowFooter="False" DataKeyField="TaskID" DataDescriptionField="Description" data
                        DataStartField="Start" DataEndField="End" DataSubjectField="Subject"
                        TimeZoneOffset="03:00:00" DayEndTime="21:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Friday"
                        EnableDescriptionField="True" AppointmentStyleMode="Default" AllowEdit="true" AllowDelete="true" AllowInsert="true">
                        <AdvancedForm Modal="true" />
                        <TimelineView UserSelectable="false" />
                        <ResourceStyles>
                            <%--AppointmentStyleMode must be explicitly set to Default (see above) otherwise setting BackColor/BorderColor
                         will switch the appointments to Simple rendering (no rounded corners and gradients)--%>
                            <telerik:ResourceStyleMapping Type="Calendar" Text="Development" />
                            <telerik:ResourceStyleMapping Type="Calendar" Text="Marketing" ApplyCssClass="rsCategoryRed" />
                            <telerik:ResourceStyleMapping Type="Calendar" Text="Work" ApplyCssClass="rsCategoryOrange" />
                        </ResourceStyles>
                        <AppointmentTemplate>
                            <div class="rsAptSubject">
                                <%# Eval("Subject") %>
                            </div>
                            <%# Eval("Description") %>
                        </AppointmentTemplate>
                        <TimeSlotContextMenuSettings EnableDefault="true" />
                        <AppointmentContextMenuSettings EnableDefault="true" />
                    </telerik:RadScheduler>
                </telerik:RadPane>
            </telerik:RadSplitter>
            <asp:SqlDataSource ID="UsersSqlDataSource" runat="server" ProviderName="System.Data.SqlClient"
                ConnectionString="Data Source=INTNSOR-D0768\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True"
                SelectCommand="SELECT * FROM [Tasks] where CompanyID=@CompanyID"
                InsertCommand="INSERT INTO [Tasks] ([Subject], [Description], [Start], [End], CompanyID) VALUES (@Subject, @Description, @Start, @End, @CompanyID)"
                UpdateCommand="UPDATE [Tasks] SET [Subject] = @Subject, [Description] = @Description, [Start] = @Start, [End] = @End WHERE TaskID = @TaskID"
                DeleteCommand="DELETE FROM [Tasks] WHERE [TaskID] =@TaskID ">
                <SelectParameters>
                    <asp:SessionParameter Name="CompanyID" SessionField="CompanyID" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="TaskID" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Subject" Type="String" />
                    <asp:Parameter Name="Description" Type="String" />
                    <asp:Parameter Name="Start" Type="DateTime" />
                    <asp:Parameter Name="End" Type="DateTime" />
                    <asp:Parameter Name="TaskID" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="Subject" Type="String" />
                    <asp:Parameter Name="Description" Type="String" />
                    <asp:Parameter Name="Start" Type="DateTime" />
                    <asp:Parameter Name="End" Type="DateTime" />
                    <asp:SessionParameter Name="CompanyID" SessionField="CompanyID" />
                </InsertParameters>
            </asp:SqlDataSource>

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 Jul 2010, 03:34 PM
Hello Bhanu Prakash,

Please, refere to the Multiple Resource Values demo.

Assigning multiple resources of the same type to an Appointment requires maintaining many-to-many relationship between resources and appointments. That is why this it is not available when binding to declarative data sources.

To use it, you need a custom provider that is capable of storing the relationships. The XML Scheduler Provider is an example for such provider. There is also a help topic on implementing a provider that supports multi-valued resources.



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
Tags
Scheduler
Asked by
Bhanu Prakash
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or