This is a migrated thread and some comments may be shown as answers.

Enum column filter - showing description instead of names

2 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jatin
Top achievements
Rank 1
Jatin asked on 09 Aug 2011, 07:43 AM
Hi,
   I have an enum column in a grid something like this

   col.Bound(m => m.UserType).ClientTemplate("<#= UserTypeEnum[UserType] #>");

The column is filterable and the default grid filter provides values to be selected from names of enum. Actually I have set "description" attribute on the Enum names and I need to display descriptions (instead of names) in the filter. How can I display "descriptions" in filter ? 

regards,
Nirvan.

2 Answers, 1 is accepted

Sort by
0
Jatin
Top achievements
Rank 1
answered on 12 Aug 2011, 12:10 PM
Hi all,
       I am stuck at this problem. I have enums for Blood Group types (like A+, A- etc). Enums does not allow values like A+ so I have created enums like A_Positive and set the description attribute to display value like A+. I can then display the description wherever enum is expected. The only hindrance is the Grid Filter where the actual enum names (like A_Positive) get populated. Any one please help me resolve this problem of displaying descriptions (like A+)   instead of names.

regards,
Nirvan.
0
Joe
Top achievements
Rank 1
answered on 24 Jan 2012, 11:19 AM
Did you find a solution to this? I need to localise the enum display names in the filter dropdown list, but there doesn't seem to be any way to do this.
Tags
Grid
Asked by
Jatin
Top achievements
Rank 1
Answers by
Jatin
Top achievements
Rank 1
Joe
Top achievements
Rank 1
Share this question
or