How to store an enum inside a DataColum of a DataTable and show localized text in .Net
- by SoMoS
Hello,
I have to store on one DataColum of one DataTable an Enum containing some values. De 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.
How can this be done?
Thanks in advance"