We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Trouble with DataSource binding

Hello,

It's possible to change my datasource when I clicked on differents views ('Day', 'Week', 'Month') ?

for example:

 when I'll click on the day view, my datasource must be like this

 <asp:SqlDataSource ID="SqlData" runat="server" ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"
            SelectCommand="SELECT * FROM [Appointment] WHERE date_appointments ='26/09/2017' ">asp:SqlDataSource>
  •  Week view binding
<asp:SqlDataSource ID="SqlData" runat="server" ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"
            SelectCommand="SELECT * FROM [Appointment] WHERE date_appointments >='26/09/2017' AND  date_appointments<='03/10/2017'">asp:SqlDataSource

Because, I can't use a global  datasource (like refer  there), when I've a table with +100000rows.


Best regards.

5 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team September 27, 2017 04:27 AM UTC

 
Thank you for contacting Syncfusion support. 
 
Load on demand feature allows the Scheduler to retrieve only the filtered appointment data (for the current Scheduler date range and current view) from the service/database during both initial rendering and navigating the views. Kindly vist the below links to know more about the Load on demand feature. 
 
Regards, 
Karthigeyan 




KE Kechaoui September 28, 2017 09:53 AM UTC

Hi,


Thanks for those links, can I've an example with SqlDataSource please ?

Because in the sample it's with a List of ScheduleAppointmentsObjData, and in my case I need to fill my schedule with appointment from a sqlserver DB,  .

So, can I've an example combining LoadOnDemand and SqlDataSource ,   it would be perfect ! 


Regards.



KK Karthigeyan Krishnamurthi Syncfusion Team September 29, 2017 07:08 AM UTC

Hi Kechaoui, 
 
Thanks for your update. 
 
We have preapred the LOD CRUD sample using sql connection which can be download from the below location. 
 
Regards, 
Karthigeyan 





KE Kechaoui October 2, 2017 02:32 PM UTC

Hi,


Thanks a lot for your answers ! It was very helpful.

However, I got a last question, It is possible to use partial postback  ?  Usually, I used updatePanel for it, but he doesn't seems to works with ej:Schedule, do you have an alternative ?

Regards.



NR Nevitha Ravi Syncfusion Team October 3, 2017 12:16 PM UTC

Hi Kechaoui, 
 
Thanks for your update. 
 
We have prepared a sample using UpdatePanel which can be downloaded from the below location. 
 

<Code> 
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server"> 
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
        <Triggers> 
            <asp:AsyncPostBackTrigger ControlID="Schedule1" /> 
        </Triggers> 
        <ContentTemplate> 
            <ej:Schedule ID="Schedule1" ClientIDMode="Static" Height="525px" EnableLoadOnDemand="true" Width="100%" CurrentDate="5/5/2014" runat="server"> 
                <AppointmentSettings ApplyTimeOffset="false" Id="Id" Subject="Subject" AllDay="AllDay" StartTime="StartTime" EndTime="EndTime" Recurrence="Recurrence" RecurrenceRule="RecurrenceRule" /> 
                <DataManager CrossDomain="true" URL="Default.aspx/GetData" CrudURL="Default.aspx/CrudResult" InsertURL="Default.aspx/InsertData" UpdateURL="Default.aspx/UpdateData" RemoveURL="Default.aspx/RemoveData" Adaptor="UrlAdaptor" /> 
            </ej:Schedule> 
        </ContentTemplate> 
    </asp:UpdatePanel> 
</asp:Content> 
</Code> 

Regards, 
Nevitha. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon