Possible to display combobox values (enums) with spaces?

Hello,

We're showing a class in the PropertyGrid with some of the properties being enums, which get represented as comboboxes in the PropertyGrid.  I was wondering if it's possible to add spaces between the words for the enum values.  For example,

Our class contains property

[DisplayName("Detect Trigger")]
public DriveDetectTrigger DetectTrigger
{
	get => _model.DetectTrigger;
	set => _model.DetectTrigger = value;
}

with the enum "DriveDetectTrigger" defined as

Snippet
public enum DriveDetectTrigger
{
        PatternClock,
        InstrumentClock,
}

Here's how the class object looks in the PropertyGrid:



Is it possible to display "PatternClock" as "Pattern Clock"?  


Thanks,

Alan


3 Replies 1 reply marked as answer

SN Sudharsan Narayanan Syncfusion Team February 16, 2022 03:01 AM UTC

Hi Alan,

You can be able to achieve the “Enum with White space” requirement by using the Enum description convertor that will help you to show the Enum with the white space. We have prepared the sample to achieve the requirement. So, please find the sample from below,

Sample: https://www.syncfusion.com/downloads/support/forum/172868/ze/PropertyGrid_EnumCheck1668265030



Please find the sample and let us know your concerns on this.

Regards,
Sudharsan


Marked as answer

AK Alan Kin replied to Sudharsan Narayanan February 16, 2022 06:48 PM UTC

Thanks for the sample; it achieves what we're looking for



SN Sudharsan Narayanan Syncfusion Team February 17, 2022 12:44 PM UTC

Hi Alan,

We are glad to know that your issue has been fixed. Please let us know if you need any other assistance. We are happy to assist you.

Regards,
Sudharsan


Loader.
Up arrow icon