'Declaration Public Property FilterAction As RecordFilterAction
public RecordFilterAction FilterAction {get; set;}
FilterAction property specifies what action to take on records that are filtered out. By default the records that do not match the filter criteria are hidden. You can set this property to Disable to disable such filtered out records instead of hiding them. You can also set this property to None in which case the data presenter will take no action on the filtered out records. They will remain visible. Records' DataRecord.IsFilteredOut property will however be updated to reflect whether the record actually matches the filter criteria. This option is useful if you want to apply some appearance to filtered-out or filtered-in records in the style or template of record elements.
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) ' By default the data presenter hides records not matching filter criteria. ' Set the FilterAction to None to keep those records in view. _dp.FieldLayoutSettings.FilterAction = RecordFilterAction.None Dim filter As RecordFilter = New RecordFilter() filter.FieldName = "Country" filter.Conditions.Add(New ComparisonCondition(ComparisonOperator.Equals, "US")) _dp.FieldLayouts(0).RecordFilters.Add(filter) ' Create a style that targets DataRecordCellArea. Dim style As Style = New Style(GetType(DataRecordCellArea)) ' Add a trigger that will highlight records green that match the filter criteria. Dim matchCriteriaTrigger As Trigger = New Trigger() matchCriteriaTrigger.Property = DataRecordCellArea.IsFilteredOutProperty matchCriteriaTrigger.Value = False matchCriteriaTrigger.Setters.Add(New Setter(Control.BackgroundProperty, Brushes.LightGreen)) ' Add a trigger that will highlight records yellow that match the filter criteria. Dim notMatchCriteriaTrigger As Trigger = New Trigger() notMatchCriteriaTrigger.Property = DataRecordCellArea.IsFilteredOutProperty notMatchCriteriaTrigger.Value = True notMatchCriteriaTrigger.Setters.Add(New Setter(Control.BackgroundProperty, Brushes.LightYellow)) style.Triggers.Add(matchCriteriaTrigger) style.Triggers.Add(notMatchCriteriaTrigger) ' Add the style. _dp.Resources.Add(GetType(DataRecordCellArea), style) 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 ) { // By default the data presenter hides records not matching filter criteria. // Set the FilterAction to None to keep those records in view. _dp.FieldLayoutSettings.FilterAction = RecordFilterAction.None; RecordFilter filter = new RecordFilter( ); filter.FieldName = "Country"; filter.Conditions.Add( new ComparisonCondition( ComparisonOperator.Equals, "US" ) ); _dp.FieldLayouts[0].RecordFilters.Add( filter ); // Create a style that targets DataRecordCellArea. Style style = new Style( typeof( DataRecordCellArea ) ); // Add a trigger that will highlight records green that match the filter criteria. Trigger matchCriteriaTrigger = new Trigger( ); matchCriteriaTrigger.Property = DataRecordCellArea.IsFilteredOutProperty; matchCriteriaTrigger.Value = false; matchCriteriaTrigger.Setters.Add( new Setter( Control.BackgroundProperty, Brushes.LightGreen ) ); // Add a trigger that will highlight records yellow that match the filter criteria. Trigger notMatchCriteriaTrigger = new Trigger( ); notMatchCriteriaTrigger.Property = DataRecordCellArea.IsFilteredOutProperty; notMatchCriteriaTrigger.Value = true; notMatchCriteriaTrigger.Setters.Add( new Setter( Control.BackgroundProperty, Brushes.LightYellow ) ); style.Triggers.Add( matchCriteriaTrigger ); style.Triggers.Add( notMatchCriteriaTrigger ); // Add the style. _dp.Resources.Add( typeof( DataRecordCellArea ), style ); }
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