views:

18

answers:

1

I have to store on one DataColum of one DataTable an Enum containing some values. The enum is defined as follow:

Imports System.ComponentModel
Imports System.Globalization

Public Enum FirmwareUpdateStatus
    <Description("updateNotExecuted")> UpdateNotExecuted = 0
    <Description("updateSuccess")> UpdateSuccess = 1
    <Description("updateError")> UpdateError = 2
End Enum

I have also a class called Enum2 that has a method called GetDescription that returns the localized text of an enum value. What I want to do is to show this text into the grid that shows the DataTable but storing the enum value, not the string.

A: 

As no one posted a solution I had to work out one by myself, maybe not the best one but it works.

What I did is to use two DataColumns, one for storing and consulting the enum value and another one for the text displayed to the user. The enum DataColum is not set to be shown at the UI grid and that's all.

Thanks anyway.

SoMoS