Enumeration in Datagrids

  • Thread starter Thread starter Thomas
  • Start date Start date
T

Thomas

Hello all,

Have stored a type value (int) in a SQLCE database, but would like to see a
text expression instead when showing in a datagrid.

Does anyone have experience with that ?

A cascading IIF(Type=1,'Text1',IIF(Type=2,'Text2',IIF(...))) as expression
for a new column would do, but this is not very good programming practices.

So if somebody knows a way of interpreting the values while showing on
screen could help.

thx in advance

TB
 
Enums override ToString method by printing the member name. Grid uses
ToString to display the row item value. I think you might be able to add a
calculated column of type of your enum and set its expression to the source
column value.
 
Back
Top