Version

Modify the Look of Filtered Records

The DataPresenter controls hide any records that do not match the filter criteria. However, you can change this behavior by setting the FieldLayoutSettings object’s FilterAction property to Disable or None. If you set the FilterAction property to Disable, any records that your end user filters out will be disabled but still visible. On the other hand, if you set the FilterAction property to None, there will be no visual indication that a record has been filtered out. This behavior allows you to implement your own style using triggers to modify the appearance of the records that your end users filter out.

Note
Note

The filter record and filter icons are not available for the xamDataCarousel™ control. However, you can add filter conditions to xamDataCarousel in XAML or in procedural code to filter your data.

xamDataPresenter Modify the Look of Filtered Records.png

The following example code demonstrates how to modify the look of filtered records. Even though the example code uses a xamDataPresenter control, you can use a xamDataGrid control in its place.

In XAML:

<!--Add the style to a resource dictionary-->
<Style TargetType="{x:Type igDP:DataRecordCellArea}">
    <Style.Triggers>
        <Trigger Property="IsFilteredOut" Value="True">
            <Setter Property="Opacity" Value=".7" />
        </Trigger>
    </Style.Triggers>
</Style>
...
<igDP:XamDataPresenter Name="xamDataPresenter1" BindToSampleData="True">
    <igDP:XamDataPresenter.FieldLayoutSettings>
        <igDP:FieldLayoutSettings FilterAction="None" />
    </igDP:XamDataPresenter.FieldLayoutSettings>
    <igDP:XamDataPresenter.FieldSettings>
        <igDP:FieldSettings AllowRecordFiltering="True" />
    </igDP:XamDataPresenter.FieldSettings>
</igDP:XamDataPresenter>

In Visual Basic:

Imports Infragistics.Windows.DataPresenter
...
Me.xamDataPresenter1.FieldLayoutSettings.FilterAction = RecordFilterAction.None
Me.xamDataPresenter1.FieldSettings.AllowRecordFiltering = True

In C#:

using Infragistics.Windows.DataPresenter;
...
this.xamDataPresenter1.FieldLayoutSettings.FilterAction = RecordFilterAction.None;
this.xamDataPresenter1.FieldSettings.AllowRecordFiltering = true;