I try to use RadDataFilter control in my application, and I get and exception whenever I change the filtered property. I belived it may be from my application and then I created a separate project where I shrink down the code to the minimum necessary, the error is still reproduced.
System.Windows.Data Error: 'MS.Internal.Data.DynamicValueConverter' converter failed to convert value 'null' (type 'null'); BindingExpression: Path='Operator' DataItem='Name IsEqualTo <Unset> ' (HashCode=61337593); target element is 'Telerik.Windows.Controls.Data.DataFilter.FilterEditor' (Name=''); target property is 'FilterOperator' (type 'Telerik.Windows.Data.FilterOperator').. System.InvalidOperationException: Can't convert type null to type Telerik.Windows.Data.FilterOperator.
at MS.Internal.Data.DynamicValueConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
at System.Windows.Data.BindingExpression.ConvertToTarget(Object value).
How I did it.
When running project (I cannot attach sample) press once "+" button to add a filter criteria.
It will display the first property filter "Name" correctly, no expcetion.
If you select another property it will throw the exception above, in "Release" mode you will not see it, but in debug you will see the error in Output window and depending if stop on exceptions is selected, the program will stop if the error occurs.
The xaml code is just like this
<Grid x:Name="LayoutRoot" Background="White">
<telerik:RadDataFilter Name="filter1" AutoGenerateItemPropertyDefinitions="True" Source="{Binding}">
</telerik:RadDataFilter>
</Grid>
public partial class MainPage : UserControl
{
public class Record
{
public string Name { get; set; }
public int Id { get; set; }
}
public ObservableCollection<Record> Records = new ObservableCollection<Record>();
public MainPage()
{
InitializeComponent();
#region Create Sample records
Records.Add(new Record()
{
Name = "U1",
Id = 1
});
Records.Add(new Record()
{
Name = "U2",
Id = 2
});
Records.Add(new Record()
{
Name = "U3",
Id = 3
});
Records.Add(new Record()
{
Name = "U4",
Id = 4
});
#endregion
filter1.DataContext = Records;
}
}