Both DataSource and DataSourceID are defined on 'RadScheduler".

2 posts, 0 answers
  1. Adigard
    Adigard avatar
    61 posts
    Member since:
    Oct 2011

    Posted 04 Oct 2011 Link to this post

    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
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 07 Oct 2011 Link to this post

    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
Back to Top