I have been unable however to get the value selected in the RadComboBox to update the underlying FilterDescription, with the Filter always ending up with 'Status isEqualTo <unset>' after selecting an item in the combo box.
I am sure I have followed the project correctly, and have the SelectedValue of the ComboBox bound to the Value property as below.
<
DataTemplate
x:Key
=
"ComboBoxEditor"
>
<
telerik:RadComboBox
SelectedValue
=
"{Binding Value, Mode=TwoWay, FallbackValue=null}"
MinWidth
=
"100"
/>
</
DataTemplate
>
The only difference I can see to the example code is that I am using the RadDataFilter unbound. It is not bound to a DataGrid, I am setting my own ItemPropertyDefinitions and using the resulting FilterDescriptions in other parts of the project. Is there a way to check that the DataTemplate Value is getting set when the RadComboBox value changes, or do I need to force the FilterDescription to update somehow as it is unbound? Finally, if nothing else is there a way to manually set the Value or update the FilterDescription when the ComboBox value changes?
Thanks
6 Answers, 1 is accepted
That is strange indeed, since the example works correctly.
You don't need to do anything besides establishing a Binding between your editor and FilterDescriptor.Value, which you have done according to the code snippet.
Can you try the following. Can you add a dummy IValueConverter that does absolutely nothing and apply it on the Value Binding. Then wait with the debugger in the value converter to see what is going back and forth. Or whether the debugger will stop there at all.
If nothing helps, please open a separate support ticket and attach a dummy sample project that reproduces this behaviour. I will debug it in order to see what is going on.
I am looking forward to hearing from you.
Ross
the Telerik team
I now realise what I had done wrong; as opposed to the sample code my EditorTemplateSelector chose the filter control to use based on the type of the ItemPropertyDefiniton rather than the name so it would work without having to specify specific ItemPropertyDefiniton names (as they are not known at design time).
To differentiate a list of possible values to be displayed in a combobox against a simple string to be typed in I used typeof(string[]) for my ItemPropertyDefnition for ones I wanted to use a combox for and checked the IsArray property in my EditorTemplateSelector to see if it should use a combobox or not. This all worked, except I assume it didn't like trying to bind the string returned from the ComboBox to the string[] Value on the ItemPropertyDefiniton (which is obvious really!)
Now I know the problem, I just need to figure out how else to differentiate between wanting to use the normal text input and a combobox instead of setting the type on the ItemPropertyDefinition to string[]
Maybe you can derive from ItemPropertyDefinition, add a new prop that will carry this info, and then fill the filter with a list of these new sub-classes. Then in the TemplateSelector, you will cast to your sub-class, read the relevant information and decide which template to supply.
Just an idea.
Ross
the Telerik team
I am facing the exact issue as the one discussed in this thread. When i create the ItemPropertyDefinition, i am setting the type as string. On the RadEditorCreated method , based on the itemproperty selected, i am calling a service to get the datasource for the combobox. When i see the FiltorDescriptors, the ComboBox selected value is unset for the first time, the reason being the once the data is been bound, the Selection Changed event is not firing for the first time. I conformed this by putting a dummy ValueConveter as you suggested in the thread and i can conform that the event is not firing. If i choose another ItemPropertyDefinition and switch back again to the first ItemPropertyDefinition, the ComboBox selection works. Any idea why it is happening ?