Visual states of SfComboBox

Hello,

i have an issue with the visual state of the SfCombobox when disabled, I do not want changes the color and gray out when disabled.
When trying to override the visual state as following, the control still grays out!

   <VisualStateGroupList>
       <VisualStateGroup x:Name="CommonStates">
           <VisualState x:Name="Normal" />
           <VisualState x:Name="Disabled" />
       </VisualStateGroup>
   </VisualStateGroupList>

3 Replies

PI Prithis Iyyappan Syncfusion Team May 31, 2024 04:23 PM UTC

Hi Karro,

 

We have investigated your query based on your update. We have prepared a sample demonstrating how to achieve your requirement with the help of Visual State Manager. Please refer to the attached sample for more details.

 

Please let us know whether the suggested sample meets your requirements. Please do not hesitate to contact us if you have any concerns or queries.

 

Regards,

Prithis I.


Attachment: ComboBoxSample_7b6103f9.zip


KA Karro June 7, 2024 09:51 AM UTC

Hello,
I have checked the sample. I think I did not make it clear what the issue is.
In my scenario I am using DataTriggers to switch between different Textcolos based on a property in my viewmodel.

My Property is an Enum and may has one of those values:
Valid, Invalid, Empty, ValidDisabled, InvalidDisabled, EmptyDisabled.

The TextColor in the SfCombobox will be changed using DataTriggers that are bound to my Property.
You see, if the control is disabled I want to apply one of 3 colors based on the Propertis value ( ValidDisabled, InvalidDisabled or EmptyDisabled ).

Using your suggestion I am able to set a single color for the disabled state. I need the control to Ignore what value is in the VisualStateManager so the DataTrigger takes charge of setting the TextColor if the control is disabled.

For other controls it is sufficient to set the disabled state as empty and it works!

<VisualState x:Name="Disabled"/>



PI Prithis Iyyappan Syncfusion Team June 12, 2024 04:26 PM UTC

Hi Karro,

 

We have investigated the reported query based on your update. We have modified the sample demonstrating how to achieve different background colors in the disabled state. We have implemented an Enum named States and implemented logic to update the disabled background color based on the states. Please refer to the attached sample for more details.

 

Please let us know whether the suggested sample meets your requirements. Please do not hesitate to contact us if you have any concerns or queries.

 

Regards,

Prithis I.


Attachment: ComboBoxSample_cdbf8d04.zip

Loader.
Up arrow icon