Im looking for a way to set the root operator to initially 'OR'. Is there a way to achieve this.
I tried setting:
public
MainPage()
{
_mainViewModel =
new
MainViewModel();
this
.DataContext = _mainViewModel;
InitializeComponent();
this
.dataFilteQuery.FilterDescriptors.LogicalOperator = Telerik.Windows.Data.FilterCompositionLogicalOperator.Or;
}
4 Answers, 1 is accepted
You can change the logical operator between the two field filters, like so:
countryFilter.FieldFilter.LogicalOperator = Telerik.Windows.Data.FilterCompositionLogicalOperator.Or;
I suggest you to check this help article, where you can find detailed information about programmatic filtering.
Yoan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Please excuse me for misleading you. In my previous post I had shown you how to set the logical operator for RadGridView.
Indeed, the logical operator of RadDataFilter has to be set as you tried. For your convenience I have prepared a sample project. Please find it attached for a reference.
All the best,
Yoan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
thank you for your quick reply.
The problem was, that I set the source of the filter (binded to my ViewModel) in the xaml instead the code behind (see attached code). This was the only change between your and my code. I wonder why this made the trick...?
Thanks again,
Daniela
<
telerik:RadDataFilter
x:Name
=
"dataFilteQuery"
Margin
=
"5 5 20 0"
Source
=
"{Binding SearchResults}"
BorderThickness
=
"0"
VerticalAlignment
=
"Stretch"
EditorTemplateSelector
=
"{StaticResource EditorTemplateSelector}"
EditorCreated
=
"dataFilterQuery_EditorCreated"
MinWidth
=
"600"
/>
Indeed, it is working as expected. You can check the attached project. As you can see, I set DataFilter's source in the XAML.
Yoan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.