Retrive value(s) from PropertyWeekdayControl

Member since: 2007

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
  • Member since: 1996

    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);


    #19695 Apr 28, 2008 11:23