I'm slowly getting through this, but it does seem to be working. So let me ask this one question to see if understand correctly how this is supposed work.
When EditorSelector.SelectTemplate is called, I loop through the rules and if I find a match, I return the DataTemplate from that rule. Is that correct?
Assuming that the data template I return is of the correct type (in my case a RadComboBox) when the EditorCreated event is fired, shouldn't the Editor be of type RadComboBox?
I have my rules setup, and when debugging, the SelectTemplate method returns a combobox correctly, but when the EditorCreated event is fired, the editor is a TextBox.
Can anyone help me understand the disconnect that I seem to be having?
public override DataTemplate SelectTemplate(object item, DependencyObject container)
var ipd = item as ItemPropertyDefinition;
if (ipd == null) return base.SelectTemplate(item, container);
foreach(var etr in EditorTemplateRules)
//this if statement works correctly and returns a RadComboBox when needed
if (etr.PropertyName == ipd.PropertyName) return etr.DataTemplate;
return base.SelectTemplate(item, container);
private void DataFilterEditorCreated(object sender, EditorCreatedEventArgs e)
var rcb = ((RadComboBox) e.Editor); //e.Editor is always a TextBox