What are the challenges you face when working across database platforms? Take the survey
Options

Need C# code snippet for dynamic options...

kraxmokraxmo Posts: 3
I am trying to query the Options enumeration using C# to populate a checklistbox with type Options, read the user-checked listbox rows and apply them to the comparison engine. Previously, I did the following:

Load: (object cb is a checklistbox object)

foreach (Option o in Enum.GetValues(typeof(Options)))
{
cb.Items.Add(o, false);
}

Read checked options:

public Options GetOptionsCheckListBoxCheckedItems(CheckedListBox cb)
{
Options tally = Options.None;
foreach (Options o in cb.CheckedItems)
{
tally |= o;
}

return tally;
}

I understand that the Option object referencing has changed from bit to method-based. I am currently trying to load the Options enum into the checkbox and return an array of type Options to include in the method call, but I am not having much luck. Any suggestions?

Comments

Sign In or Register to comment.