StrataFrame Forum

Data binding [flag] enum

http://forum.strataframe.net/Topic12743.aspx

By Chan - 11/17/2007

Hi,

I would like to use flag enum to store combination of multiple values. How could I find to checkbox for this?



Thank you
By Trent L. Taylor - 11/19/2007

It sounds like you are trying to create a bitwise enum using the Flag attribute.  This is a very good approach when you may want to store multiple values into a single integer field.  Binding to a checkbox is going to have to be something done on your side and totally depends on your logic.  By deafult, this logic will not work as a checkbox is a Boolean which is a Bit or only supports 0 and 1.  Since your enum will already exceed this logic, you may be better suited going with a combo box or a checked list box.  Something of that nature.
By Greg McGuffey - 11/19/2007

One possibility to handle this logic would be to handle it with custom field properties. Add custom field properties which set or clear the flag in the main, db linked, bitwise enum field. You could then directly link these custom fields to the bitwise enum field.