'Declaration Public Class ConditionGroup Inherits System.Collections.ObjectModel.ObservableCollection(Of ICondition) Implements ICondition
public class ConditionGroup : System.Collections.ObjectModel.ObservableCollection<ICondition>, ICondition
ConditionGroup class is used for grouping multiple conditions. ConditionGroup itself implements ICondition interface and therefore you can create arbitrarily nested groups of conditions.
Conditions contained in the condition group are combined using the logical operator specified by the LogicalOperator property.
Imports Infragistics.Windows Imports Infragistics.Windows.Controls Imports Infragistics.Windows.Editors Imports Infragistics.Windows.DataPresenter Imports Infragistics.Windows.DataPresenter.Events Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Dim fieldLayout As FieldLayout = _dp.FieldLayouts(0) ' Create a filter that shows 'Percent' field where the values are less than 0 ' or greater than 100. Dim filter As RecordFilter = New RecordFilter() filter.FieldName = "Percent" filter.Conditions.Add(New ComparisonCondition(ComparisonOperator.LessThan, 0)) filter.Conditions.Add(New ComparisonCondition(ComparisonOperator.GreaterThan, 100)) ' By default the LogicalOperator is 'And'. Since we want to 'Or' the above two ' conditions, set the LogicalOperator on the condition group to 'Or'. filter.Conditions.LogicalOperator = LogicalOperator.Or ' Apply the filter to the data presenter. fieldLayout.RecordFilters.Add(filter) End Sub
using Infragistics.Windows; using Infragistics.Windows.Controls; using Infragistics.Windows.Editors; using Infragistics.Windows.DataPresenter; using Infragistics.Windows.DataPresenter.Events; public void Window1_Loaded( object sender, RoutedEventArgs e ) { FieldLayout fieldLayout = _dp.FieldLayouts[0]; // Create a filter that shows 'Percent' field where the values are less than 0 // or greater than 100. RecordFilter filter = new RecordFilter( ); filter.FieldName = "Percent"; filter.Conditions.Add( new ComparisonCondition( ComparisonOperator.LessThan, 0 ) ); filter.Conditions.Add( new ComparisonCondition( ComparisonOperator.GreaterThan, 100 ) ); // By default the LogicalOperator is 'And'. Since we want to 'Or' the above two // conditions, set the LogicalOperator on the condition group to 'Or'. filter.Conditions.LogicalOperator = LogicalOperator.Or; // Apply the filter to the data presenter. fieldLayout.RecordFilters.Add( filter ); }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2