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

Both DataSource and DataSourceID are defined on 'RadScheduler".

1 Answer 102 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Adigard
Top achievements
Rank 1
Adigard asked on 04 Oct 2011, 10:05 AM
Greetings,

i've been trying to use RadScheduler for a few hours and i have already a problem.
Got this error "Both DataSource and DataSourceID are defined on 'RadScheduler".

I don't understand why since i haven't defined a datasource anywhere. Just DataSourceID trying to set a DataSource.
All my code was so far generated automatically


This is what i have:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadSchedulerWebForm.aspx.cs" Inherits="RadSchedulerWebForm" %>

<%@ Register src="RadSchedulerWebFormAdvancedForm.ascx" tagname="AdvancedForm" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your Java Script code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Forest">
    </telerik:RadSkinManager>
    <div>
        <telerik:RadScheduler runat="server" ID="RadScheduler1"
            Width="750px"
            OnAppointmentInsert="RadScheduler1_AppointmentInsert"
            OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
            OnAppointmentDelete="RadScheduler1_AppointmentDelete"
            DataKeyField="idRDV" DataSubjectField="objet" DataStartField="debut" DataEndField="duree"
            DataRecurrenceField="objet" DataRecurrenceParentKeyField="objet"
            StartInsertingInAdvancedForm="True" DataDescriptionField="description"
            DataSourceID="SqlDataSource1">

            <AdvancedEditTemplate>
            <uc1:AdvancedForm    runat="server" ID="AdvancedEditForm"
                                        Subject='<%# Bind("Subject") %>'
                                        Start='<%# Bind("Start") %>'
                                        End='<%# Bind("End") %>'/>
               <div style="text-align: right">
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update"/>
                    <asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"/>
               </div>
            </AdvancedEditTemplate>
            <AdvancedInsertTemplate>
            <uc1:AdvancedForm    runat="server" ID="AdvancedInsertForm"
                                        Subject='<%# Bind("Subject") %>'
                                        Start='<%# Bind("Start") %>'
                                        End='<%# Bind("End") %>'/>
                <div style="text-align: right">
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert"/>
                    <asp:Button ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"/>
                </div>
            </AdvancedInsertTemplate>
    </telerik:RadScheduler>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:IntranetConnectionString %>"
            SelectCommand="SELECT [objet], [debut], [duree], [heure], [description], [lieu], [idRDV] FROM [rendezvous]">
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>




thank you in advance for you help

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Oct 2011, 08:47 AM
Hello Rambert,

I tested your code, but could not reproduce the issue. It seems the error is not caused by the RadScheduler. Here is an interesting article about it.

I am sending you a working project with a SqlDataSource, without the advanced Templates.

Hope this will be helpful.

All the best,
Plamen Zdravkov
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Scheduler
Asked by
Adigard
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or