Hi,
Thank you for reply.
However, I still unable to make it.
I declared enum, able to populate combobox by refer to enum, set it as custom data field type in BO mapper (able to search from data type browse dialog). However, when I click new button, I still hit error.
CompanyAddressBO.cs
namespace JK.Inventory.BusinessObject
{
public enum AddressType { Corresponding, Shipping, Billing };
[Serializable()]
public partial class CompanyAddressBO : MicroFour.StrataFrame.Business.BusinessLayer
{
}
}
CompanyAddressBO.designer.cs
namespace JK.Inventory.BusinessObject
{
public enum AddressType { Corresponding, Shipping, Billing };
[Serializable()]
public partial class CompanyAddressBO : MicroFour.StrataFrame.Business.BusinessLayer
{
[Browsable(false),
BusinessFieldDisplayInEditor(),
Description("This field was imported."),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public JK.Inventory.BusinessObject.AddressType AddressTypeID
{
get
{
// ERROR HERE!!!!!!
return (JK.Inventory.BusinessObject.AddressType)this.CurrentRow["AddressTypeID"];
}
set
{
this.CurrentRow["AddressTypeID"] = value;
}
}
}
}
Error:
System.InvalidCastException was unhandled by user code
Message="Specified cast is not valid."
Source="InventoryBusinessObject"
StackTrace:
at JK.Inventory.BusinessObject.CompanyAddressBO.get_AddressTypeID() in F:\Projects\Inventory\InventoryBusinessObject\CompanyAddressBO.Designer.cs:line 321
at JK.Inventory.BusinessObject.CompanyAddressBO.Field_AddressTypeID_Descriptor.GetValue(Object component) in F:\Projects\Inventory\InventoryBusinessObject\CompanyAddressBO.Designer.cs:line 751
at System.Windows.Forms.BindToObject.GetValue()
at System.Windows.Forms.Binding.PushData(Boolean force)
Thank you