This works the very same way as the ListView. First, have you tried to just allow the enum to populate within it. By default, any strong-typed column using an enum will attempt to perform a ToString which shold return the enum value without you having to do anything in the RowPopulating. However, if you choose to go the RowPopulating route, just set the column that will house this value to PopulatedThroughEvent rather the a formatted value. Then set the event args value when the event is raised:With CType(e.BusinessObject, MyBOType)
e.Columns(1).DisplayValue = .MyEnumField.ToString()
EndWith
A better way to parse the enum is to provide an attribute so you can get a more accurate display description:
Public Enum MyEnum As Integer
<MicroFour.StrataFrame.Tools.EnumDisplayValue("Apple", False)> _
Item1 = 0
<MicroFour.StrataFrame.Tools.EnumDisplayValue("Orange", False)> _
Item2 = 1
<MicroFour.StrataFrame.Tools.EnumDisplayValue("Pear", False)> _
Item3 = 3
End Enum
Then parse it out this way:
e.Columns(1).DisplayVaue = MicroFour.StrataFrame.Tools.Common.GetEnumDisplayValue(.MyEnumField)