Hi.
I'm using a DatePicker to show data about a specific date, and there are also dates in which no data is related. Hence, I'm populating the picker with special days using the OnLoad event, enabling and disabling the dates between the MinDate and MaxDate, as it's being needed.
This is how I've done so far, populating from the picker's MinDate to the MaxDate, which works, but I'd like to populate by requesting dates everytime I navigate, within the picker's CalendarView, so everytime a request occurs, I only process no more than 40 Special Days, not every date of several months and so on:
How could I add the special days every time navigation occurs? I want to enable and disable these dates on navigation within the view, because a lot of dates would be involved in the process.
Regards.
I'm using a DatePicker to show data about a specific date, and there are also dates in which no data is related. Hence, I'm populating the picker with special days using the OnLoad event, enabling and disabling the dates between the MinDate and MaxDate, as it's being needed.
This is how I've done so far, populating from the picker's MinDate to the MaxDate, which works, but I'd like to populate by requesting dates everytime I navigate, within the picker's CalendarView, so everytime a request occurs, I only process no more than 40 Special Days, not every date of several months and so on:
protected
void
DatePicker_Load(
object
sender, EventArgs e)
{
RadDatePicker picker = sender
as
RadDatePicker;
DateTime[] dates = controller.GetCustomerBaseDates();
picker.MinDate = dates.Min();
picker.MaxDate = dates.Max();
for
(DateTime d1 = picker.MinDate; d1 <= picker.MaxDate; d1 = d1.AddDays(1))
{
RadCalendarDay day;
bool
exists = dates.Contains(d1);
day =
new
RadCalendarDay { Date = d1, IsSelectable = exists, IsDisabled = !exists };
day.ItemStyle.CssClass = exists ?
"rcDataExists"
:
"rcDisabled"
;
picker.Calendar.SpecialDays.Add(day);
}
}
How could I add the special days every time navigation occurs? I want to enable and disable these dates on navigation within the view, because a lot of dates would be involved in the process.
Regards.