Completed
Last Updated: 13 Dec 2021 08:00 by ADMIN
Release LIB 2021.3.1206 (6 Dec 2021)
Martin Ivanov
Created on: 17 Nov 2021 14:28
Category: ComboBox
Type: Feature Request
0
ComboBox: The Background property setting doesn't change the background color of the control

Setting the Background property of RadComboBox no longer changes the background color of the control.

To work this around, you can add a global event handler for the Loaded event of RadComboBox and set the corresponding backgrounds in code.

static MainWindow()
{
	EventManager.RegisterClassHandler(typeof(RadComboBox), RadComboBox.LoadedEvent, new RoutedEventHandler(OnComboBoxLoaded));
}

private static void OnComboBoxLoaded(object sender, RoutedEventArgs e)
{
	var comboBox = (RadComboBox)sender;
	if (!comboBox.IsEditable)
	{
		if (comboBox.IsEnabled)
		{
			var buttonChrome = comboBox.FindChildByType<ButtonChrome>();
			buttonChrome.Background = Brushes.Purple;
		}
		else
		{
			comboBox.Background = Brushes.Purple;
		}                
	}	
}

0 comments