I have an application that hides certain properties on the underlying object for a PropertyGrid depending on selected value of an Enum property displayed in a combo box.
(see attached pictures).
This was achieved by code below.
With a newer release of Syncfusion that we installed recently, left-clicking on one of the combo box choices no longer seems to raise SelectionChanged event.
Right clicking the choice first, and then left-clicking or hitting enter DOES work.
Is there some new option or code I should use to change selection on combo box ?
void _PropertyGrid_SelectedPropertyItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
PropertyGrid prop = d as PropertyGrid;
if (prop.SelectedPropertyItem != null)
{
object typeinstance = prop.SelectedPropertyItem.PropertyEditor.GetType();
if (prop.SelectedPropertyItem.DisplayName == "SearchType")
{
ComboBox property = prop.SelectedPropertyItem.PropertyEditor as ComboBox;
if (property != null)
{
property.SelectionChanged += property_SelectionChanged;
}
}
}
}
void property_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ComboBox instance = sender as ComboBox;
if (instance != null)
{
HideProperties();
}
}
Attachment:
ComboBox_fcbeb00c.7z