We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Bind SfCobobox to Enum

I am wondering if it is possible to bind the ItemsSource of a SfCombobox to an Enum? Should I create an ObservableCollection<myEnum> to use it as my ItemsSource?  And populate this property in the constructer using something like: 

Enum.GetValues(typeof(myEnum))


Do you have any examples on how to achieve this as this is a common use case of a ComboBox ?


3 Replies

VV Vijayakumar Viswanathan Syncfusion Team October 18, 2022 09:14 AM

Hi Mohammed,

 

Query: if it is possible to bind the ItemsSource of a SfCombobox to an Enum-type property?

 

We have prepared a sample with the requirements you mentioned in the query. Get the sample from the attachment. 


Please check the sample and let us know if you have any further queries.

 

Regards,

Vijayakumar


Attachment: ComboBoxEnumSample_55acddf4.zip


MO Mohammed October 18, 2022 02:28 PM

This works! Thanks for the quick respond



RS Ruba Shanmugam Syncfusion Team October 18, 2022 11:41 PM

Hi Mohammed,


Thanks for the update. Please let us know if you have any further queries on this. We are happy to help.


Regards,

Ruba Shanmugam


Loader.
Live Chat Icon For mobile
Up arrow icon