Column show enum display name instead of enum value or string

Hi Syncfusion team,

I have a grid with a enum dropdownlist column . I need to show a custom display name instead of the int or string value of the enum when the datagrid is loaded, when the cell is edited and when the changes are saved.

Right now, I was able to display the custom name when the grid is loaded and when it's saved, but I'm not able to show the custom name when the cell has been edited but not saved yet.


When the grid is loaded:

When the dropdown is clicked:

When the dropdown value is changed:

This is the wrong case that I'm trying to fix. There should be displayed 21% and not _21p.

When the grid is updated:


And the code for the Enum:

The code for the grid


Thanks.


3 Replies

RN Rahul Narayanasamy Syncfusion Team July 21, 2021 12:06 PM UTC

Hi Antonio, 

Greetings from Syncfusion. 

Query: facing problem while displaying Enum column values in editing 

We have validated your query and we suspect that you are facing problem while displaying Enum column values while editing. Here, we have prepared a simple sample based on your requirement. Find the below sample for your reference. 


Please let us know if you have any concerns. 

Regards, 
Rahul 



AP Antonio Perdomo Pastor August 2, 2021 07:19 AM UTC

Hi, thanks for the reply, but that solution doesn't resolve my problem.


I'm able to show the text value of the enums in the dropdown list, but thats not an option here because the client want to see white spaces or values starting with numbers -something that enums are not able. And not the underscore '_' character.

Thats the reason I used the display attribute and not the enum text value. Right now, I'm able to display the custom name when the grid is loaded and when it's saved after any change, but I'm not able to show that custom name when the cell has been edited but not saved yet.


Sorry if I didn't explain myself properly the first time, english isn't my first language.

Again, thanks for trying to help me.

Antonio



JP Jeevakanth Palaniappan Syncfusion Team August 3, 2021 07:00 AM UTC

Hi Antonio, 
 
We understand that you want to render the custom display name in both column template and also during the cell save. For this we suggest you to update the Syncfusion NuGet package to the latest version(19.2.51). In this version, we have included a fix based on your scenario. 
 
Please get back to us if you have any other queries. 
 
Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon