|
Rank: Newbie Groups: Member
Joined: 12/29/2013 Posts: 4
|
Hallo I have a problema with the calender. If i try to set a Range of disabled days like Calendar1.DisabledDates.Add(New DateRange(New DateTime(2014, 1, 1), New DateTime(2014, 12, 31)) i get an error "The Typ DateRange is not defined" I can't find the soloution by myself. i'm working with VB net 2010 regards Uli
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
The full type name of DateRange is EO.Web.DateRange. You can take a look of the reference section to see all the class names.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/29/2013 Posts: 4
|
Hallo EO.Web.DateRange don't exist in EO.Web, only in EO.Wpf Think my failure, i'm working with ASPX VB NET to créate websites, not the VB NET Forms How can i disable serveral DateRanges like 1 week in April and annother week in May. I am using the following code
for i = 0 to 3 Dim mStartDate As New DateTime mStartDate = MSSQL-DataBase-Field (is a Date Filed) If i use Calendar1.DisabledDates.SelectRange(mStartDate, mStartDate.AddDays(7)) next
It Works, but only for one selection.
regards Uli Rosendahl
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
You are right. There is no DateRange in EO.Web. We have confused it with EO.Wpf. Sorry about the mistake.
For now in order to disable a full week, you have to use a loop to add all 7 days into DisabledDates collection. We will look into it to see if it is possible to support DateRange in the future.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/29/2013 Posts: 4
|
Ok, thanks I got it working. I understood that .DisabledDates.SelectRange(StartDate, EndDate.) will do the job, but it Works only 1 time. If i repeat this it will show only the last SelectedRange.
But with a Do Loop is 3 Lines more of code, but Works as expected. Thanks Uli
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
Glad to hear that you got it working and thanks for the update!
SelectRange indeed add all the days in the range into the collection. However internally it calls Clear. So it only works with a single range. We will change our code to allow it to be called multiple times in our next build.
Thanks!
|
|