Hi,
I need to change the colors of SfComboBox in disabled state.
change of DisabledBackColor works as expected.
but DisabledForeColor is not changing the color of the font. It stays in a greyish color.
example:
sfcombobox1.Enabled = False
sfcombobox1.Style.EditorStyle.DisabledBackColor = Color.White
sfcombobox1.Style.EditorStyle.DisabledForeColor = Color.Black
Regards
Dennis
Hi,
I am using VB.net instead of C#.
When using DropDownStyle = DropDownList I understand that one needs to use
ReadOnlyEditorStyle. EditorStyle is doing nothing with the colors in this case.
so this is working:
SfComboBox1.DropDownStyle = Syncfusion.WinForms.ListView.Enums.DropDownStyle.DropDownList
SfComboBox1.Enabled = False
SfComboBox1.Style.ReadOnlyEditorStyle.DisabledBackColor = Color.Blue
SfComboBox1.Style.ReadOnlyEditorStyle.DisabledForeColor = Color.White
But I rather want DropDownStyle = DropDown.
So this example is changing the Background but not the Foreground color:
SfComboBox1.DropDownStyle = Syncfusion.WinForms.ListView.Enums.DropDownStyle.DropDown
SfComboBox1.Enabled = False
SfComboBox1.Style.EditorStyle.DisabledBackColor = Color.Yellow
SfComboBox1.Style.EditorStyle.DisabledForeColor = Color.Red
Where is the mistake?
Regards
Dennis
I am facing the same issue. I am using version 19.2.0.55.
If possible please provide the patch for this.
Thanks.
Gautam
Recommended approach - exe will perform automatic configuration.
Please find the patch setup from below location:
Please find the patch assemblies alone from below location:
Assemblies Link: https://syncfusion.com/Installs/support/patch/19.2.0.55/809864/F170926/SyncfusionPatch_19.2.0.55_809864_1212022061803949_F170926.zip
NuGet link:
|
if on the form designer the ComboBoxMode property is set to "SingleSelection" then the code
SfComboBox1.Style.EditorStyle.DisabledBackColor = Color.Yellow
SfComboBox1.Style.EditorStyle.DisabledForeColor = Color.Red
does not take any effect.
Now, if the ComboBoxMode is set to multiselection then the color setting does apply.
this is a very strange behavior , I can characterized it as bug.
NN
Hi NN,
Thanks for contacting Syncfusion support.
We have checked your query and we understand that when the ComboBoxMode property is set to SingleSelection DisabledBackColor and DisabledForeColor are not working properly. But we can able to set the DisabledForeColor and its working fine from our end. Please refer to the screenshot for your reference.
Could you please provide the following details
Hi,
I have the same problem with the latest version. I have an inherited custom SfCombobox control, that referencing other files, so I cannot create an example but I created a simle button in my code to change combobox style at runtime:
private void myButton1_Click(object sender, EventArgs e)
{
cbTermekcsoport.BackColor = GraboColor.ReadOnlyControlGrayForeColor;
cbTermekcsoport.Style.ReadOnlyEditorStyle.BackColor = GraboColor.ReadOnlyControlGrayForeColor;
cbTermekcsoport.Style.ReadOnlyEditorStyle.DisabledBackColor = GraboColor.ReadOnlyControlGrayForeColor;
cbTermekcsoport.Style.EditorStyle.DisabledBackColor = GraboColor.ReadOnlyControlGrayForeColor;
}
This works fine, the combobox backcolor will be set.
But this code has no effect:
private void myButton1_Click(object sender, EventArgs e)
{
cbTermekcsoport.ForeColor = GraboColor.ReadOnlyControlGrayForeColor;
cbTermekcsoport.Style.ReadOnlyEditorStyle.ForeColor = GraboColor.ReadOnlyControlGrayForeColor;
cbTermekcsoport.Style.ReadOnlyEditorStyle.DisabledForeColor = GraboColor.ReadOnlyControlGrayForeColor;
cbTermekcsoport.Style.EditorStyle.DisabledForeColor = GraboColor.ReadOnlyControlGrayForeColor;
}
Unfortunatelly the forecolor never changing.
Thank you for help!