[Browsable(false),BusinessFieldDisplayInEditor(),Description("ACTIONTYPECODE"),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]public InspectionType ACTIONTYPECODE{ get { return (InspectionType)Enum.Parse(typeof(InspectionType), this.CurrentRow["ACTIONTYPECODE"] ); } set { this.CurrentRow["ACTIONTYPECODE"] = value; }}
This works thus far, I'd just like to know if there is something I'm missing or some larger problem. -Thanks
[
and here is the enum:
public enum InspectionType{ Foo= 0, Bar= 1, Zip= 2}
Nothing too complex. Stepping through the cose I can assign a value to ACTIONTYPECODE without issue. But when I hit the 'Get' I end up with this error:Cannot unbox 'this.CurrentRow["ACTIONTYPECODE"]' as a 'InspectionType'
Now this would make sense to me since the field seems to be stored as a string and last time I tried I had to do something like this: (InspectionType)Enum.Parse(typeof(InspectionType), "Foo"); to cast a string as an enum. What am I screwing up?