Binding a CheckBoxList to an Enum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to bind a checkboxList to an enum type. I have the following code, but
for some reason, unknown to me, it does not work:


public enum TagCollectionType
{
Black, White
};

foreach (string searchType in Enum.GetNames(typeof(TagCollectionType)))
{
rdolstSearchType.DataTextField = searchType;
rdolstSearchType.DataValueField = searchType;
}

What am I doing wrong?

-HS
 
Back
Top