Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Retrive value(s) from PropertyWeekdayControl

Vote:
 

How do I retrive selected weekdays in a PropertyWeekdayControl?

I only get one number, even if more weekdays have been selected.

#19676
Apr 24, 2008 14:00
Vote:
 

Hi Johan!

Selected weekdays values are simple OR:ed together to form one single value (which is easy and fast to store/retrieve);

Weekday values are: Monday=1, Tuesday=2, Wednesday=4 and so on.

To find out what weekdays are selected, you can use something like this:

bool ismondaySelected = 1==(propertyWeekdayControl.Number & 1);
bool istuesdaySelected = 2==(propertyWeekdayControl.Number & 2);
...
bool issundaySelected = 64==(propertyWeekdayControl.Number & 64);

/johan

#19695
Apr 28, 2008 11:23
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.