I've a radscheduler reading it's data in from a provider (which connects to exchange). If there's no account to connect to, or a problem with the service, I want the scheduler to simply be disabled and not render.
So I thought this simple peice of logic would do the trick:
However, even though the scheduler shouldn't be enabled now in theory, it seems to ignore this and is desperate to try and databind. I get the following error:
Nowhere in my code do I set a datasource or tell it to databind.
I don't want it to databind or do anything, how do I disable the control?
So I thought this simple peice of logic would do the trick:
if (Service != null)
{
Calendar.DayStartTime = TimeSpan.Parse("05:00:00");
Calendar.DayEndTime = TimeSpan.Parse("23:00:00");
Calendar.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");
Calendar.WeekView.HeaderDateFormat = "d";
ScheduleProvider ExchangeScheduleProvider = new ScheduleProvider();
ExchangeScheduleProvider.ExchangeService = Service;
Calendar.Provider = ExchangeScheduleProvider;
}
else
{
Calendar.Enabled = false;
Calendar.Visible = false;
}
However, even though the scheduler shouldn't be enabled now in theory, it seems to ignore this and is desperate to try and databind. I get the following error:
|
Nowhere in my code do I set a datasource or tell it to databind.
I don't want it to databind or do anything, how do I disable the control?