I am trying to figure out if the DayOfWeek Enumeration list can be sorted by using the integer value (ie Sunday = 0). Ultimately I want to take the DayOfWeek Enumeration list and population a dropdownlist with the days of the week from Sunday – Monday and I do not want to hard code the items in the HTML markup. Is this possible?
Share
So you want to bind the
DayOfWeekenum to aDropDownList?This should work, although i wouldn’t use an enum as
DataSourcefor a DropDownList:This is sorted by the integer value by default, hence it starts with
Sunday. You could change it easily with anOrder By.