Hi,
For anyone who is interested the following seems to work ok when binding a DevExpress lookup edit to an internal enum. It involves creating a BO for each enum which, of course, gives great portability.
1. Make a generic view to use when creating an enum BO:
SELECT '' AS Description, '' AS Value
2. Created BO using the above view. In this example we are creating a BO for our DeviceType enums.
3. Created Business Binding Source mapped to the BO.
4. Add this code to the enum's BO's ParentFormLoading event:
Private Sub boEnumDeviceType_ParentFormLoading() Handles Me.ParentFormLoading
Dim dt As New Data.DataTable
dt = MicroFour.StrataFrame.Tools.Common.BuildDataTableFromEnum(GetType(TMS_Test_01.TMSEnums.DeviceType))
Me.CopyDataFrom(dt, MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromCompleteTable)
dt = Nothing
End Sub
5. Created a LookUpEdit control in DevExpress using the BBS as the datasource and mapped Description as the display member and Value as the value member.
And that was it. The combo box shows the enum descriptions and the value saved to the database is enum's integer value.
So, all we need to do is create BO's for each of our enums that are visible on the UI and use them just as we would a table.
Cheers, Peter