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.
Unfortunately, activation email could not send to your email. Please try again.

"Lazy" Databinding

Thread ID:

Created:

Updated:

Platform:

Replies:

80152 Mar 17,2009 04:26 PM Mar 25,2009 09:42 AM ASP.NET Web Forms (Classic) 3
loading
Tags: Schedule
Israel Aece
Asked On March 17, 2009 04:26 PM

Hello,

I'm binding the Schedule control throught database. But I have many records, so I decided to populate the control with current month records.

But, how I could intercept month change and, re-populate the control with new data? I'm intercepting throught of event StartDateChanged, but how this event occurs in async fashion, I cannot refresh whole schedule.

Have you another approach for this?

Best Regards


Selvavinayagam S [Syncfusion]
Replied On March 19, 2009 05:01 AM

Hi Israel,

Thank you for using Syncfusion products.

Syncfusion Schedule control do not provide builtin support to handle the database query before fetching the data from database. So we need to create dynamic query to meet your requirement.

Here we are creating dynamic select command based on the ScheduleType and StartDate properties.
Following code snippet select the appointment from the datasource based on the schedule start date and schedule view type.

[c#]

if (this.Schedule1.ScheduleType == ScheduleViewType.Day)
this.AppointmentDataSource.SelectCommand = "SELECT * FROM [AppointmentsTable] WHERE [StartTime] BETWEEN#" + Schedule1.StartDate + "#" + "AND#" + Schedule1.StartDate.AddDays(1) + "# ";

if (this.Schedule1.ScheduleType == ScheduleViewType.Week)
this.AppointmentDataSource.SelectCommand = "SELECT * FROM [AppointmentsTable] WHERE [StartTime] BETWEEN#" + Schedule1.StartDate + "#" + "AND#" + Schedule1.StartDate.AddDays(7) + "# ";

if (this.Schedule1.ScheduleType == ScheduleViewType.WorkWeek)
this.AppointmentDataSource.SelectCommand = "SELECT * FROM [AppointmentsTable] WHERE [StartTime] BETWEEN#" + Schedule1.StartDate + "#" + "AND#" + Schedule1.StartDate.AddDays(5) + "# ";


Please refer the sample in the following link which illustrate the above.

http://www.syncfusion.com/support/user/uploads/Sample_f0f3793a.zip

Please let us know if this helps.

Regards,
Selva


Israel Aece
Replied On March 24, 2009 12:02 PM

Hello Selva,

Thanks for your reply.

This approach worked. But my problem is that user is clicking in "<" and ">" buttons, navigating day by day.

In case, when user change for previous month or next month, the schedule is empty, because it was filled it with current month data.

Best Regards,



Selvavinayagam S [Syncfusion]
Replied On March 25, 2009 09:42 AM

Hi Israel,

Thank you for using Syncfusion products.

Please refer the sample in the following link, which demonstrate how to retrieve the data from Database based on the Schedule visible Days.

http://www.syncfusion.com/support/user/uploads/DataBindingSample_b61ff777.zip

In this sample, we just calculate the Visible days, through the event CheckVisibleDays. And create the select command based on the visible days.

Please let us know if this helps.

Regards,
Selva


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;