WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeGridFilterControl

    Show / Hide Table of Contents

    Class TreeGridFilterControl

    Represents a control that contains the details about how to filter the data in SfTreeGrid by using the filter popup in TreeGridFilterControl.

    Inheritance
    System.Object
    TreeGridFilterControl
    Implements
    System.IDisposable
    System.ComponentModel.INotifyPropertyChanged
    Namespace: Syncfusion.UI.Xaml.TreeGrid.Filtering
    Assembly: Syncfusion.Grid.WinUI.dll
    Syntax
    public class TreeGridFilterControl : ContentControl, IDisposable, INotifyPropertyChanged

    Constructors

    TreeGridFilterControl()

    Initializes a new instance of the TreeGridFilterControl class.

    Declaration
    public TreeGridFilterControl()

    Fields

    AdvancedFilterStyleProperty

    . Identifies the AdvancedFilterStyle dependency property.

    Declaration
    public static readonly DependencyProperty AdvancedFilterStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the AdvancedFilterStyle dependency property.

    AllowBlankFiltersProperty

    Identifies the AllowBlankFilters dependency property.

    Declaration
    public static readonly DependencyProperty AllowBlankFiltersProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the AllowBlankFilters dependency property.

    AscendingSortStringProperty

    Identifies the AscendingSortString dependency property.

    Declaration
    public static readonly DependencyProperty AscendingSortStringProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the AscendingSortString dependency property.

    CheckBoxFilterStyleProperty

    Identifies the CheckBoxFilterStyle dependency property.

    Declaration
    public static readonly DependencyProperty CheckBoxFilterStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the dependency property.

    DescendingSortStringProperty

    Identifies the DescendingSortString dependency property.

    Declaration
    public static readonly DependencyProperty DescendingSortStringProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the DescendingSortString dependency property.

    FilterColumnTypeProperty

    Identifies the FilterColumnType dependency property.

    Declaration
    public static readonly DependencyProperty FilterColumnTypeProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the FilterColumnType dependency property.

    FilteredFromProperty

    Identifies the FilteredFrom dependency property.

    Declaration
    public static readonly DependencyProperty FilteredFromProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the FilteredFrom dependency property.

    FilterModeProperty

    Identifies the FilterMode dependency property.

    Declaration
    public static readonly DependencyProperty FilterModeProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the FilterMode dependency property.

    FilterPopupHeightProperty

    Identifies the FilterPopupHeight dependency property.

    Declaration
    public static readonly DependencyProperty FilterPopupHeightProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the FilterPopupHeight dependency property.

    FilterPopupWidthProperty

    Identifies the FilterPopupWidth dependency property.

    Declaration
    public static readonly DependencyProperty FilterPopupWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the dependency property.

    HorizontalOffsetProperty

    Identifies the HorizontalOffset dependency property.

    Declaration
    public static readonly DependencyProperty HorizontalOffsetProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the HorizontalOffset dependency property.

    ImmediateUpdateColumnFilterProperty

    Identifies the ImmediateUpdateColumnFilter dependency property.

    Declaration
    public static readonly DependencyProperty ImmediateUpdateColumnFilterProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the ImmediateUpdateColumnFilter dependency property.

    IsAdvancedFilterVisibleProperty

    Identifies the IsAdvancedFilterVisible dependency property.

    Declaration
    public static readonly DependencyProperty IsAdvancedFilterVisibleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the IsAdvancedFilterVisible dependency property.

    IsOpenProperty

    Identifies the IsOpen dependency property.

    Declaration
    public static readonly DependencyProperty IsOpenProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    ResizingThumbVisibilityProperty

    Identifies the ResizingThumbVisibility dependency property.

    Declaration
    public static readonly DependencyProperty ResizingThumbVisibilityProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the ResizingThumbVisibility dependency property.

    SortOptionVisibilityProperty

    Identifies the SortOptionVisibility dependency property.

    Declaration
    public static readonly DependencyProperty SortOptionVisibilityProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the SortOptionVisibility dependency property.

    VerticalOffsetProperty

    Identifies the VerticalOffset dependency property.

    Declaration
    public static readonly DependencyProperty VerticalOffsetProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty
    Remarks

    The identifier for the VerticalOffset dependency property.

    Properties

    AdvancedFilterStyle

    Gets or sets the style that is applied to the TreeGridAdvancedFilterControl.

    Declaration
    public Style AdvancedFilterStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style which is applied to the TreeGridAdvancedFilterControl.The default value is null.

    Remarks

    To define the Microsoft.UI.Xaml.Style for an AdvancedFilter, then you should specify the TargetType as TreeGridAdvancedFilterControl.

    Examples
    <Grid.Resources>
        <Style x:Key="advancedfilterstyleforEmployeeID" BasedOn="{StaticResource AdvancedFilterControlStyle}" TargetType="treeGrid:TreeGridAdvancedFilterControl">
            <Setter Property="CanGenerateUniqueItems" Value="False" />
        </Style>
        <Style x:Key="popupstyleforEmployeeID" BasedOn="{StaticResource GridFilterControlStyle}" TargetType="treeGrid:TreeGridFilterControl">
            <Setter Property="FilterMode" Value="Both" />
            <Setter Property="AdvancedFilterStyle" Value="{StaticResource advancedfilterstyleforEmployeeID}" />
        </Style>
    </Grid.Resources>
      <treeGrid:SfTreeGrid Name="sfTreeGrid" ChildPropertyName="ReportsTo" AutoGenerateColumns="False" ItemsSource="{Binding Employees}" ParentPropertyName="ID" SelfRelationRootValue="-1" >                   
           <treeGrid:SfTreeGrid.Columns>
                <treeGrid:TreeGridTextColumn MappingName="EmployeeID" HeaderText="Employee ID" FilterPopupStyle="{StaticResource popupstyleforEmployeeID}" AllowFiltering="True"/>
           </treeGrid:SfTreeGrid.Columns>
      </treeGrid:SfTreeGrid>

    AdvancedFilterType

    Gets or sets which type of AdvancedFilter is loaded to the TreeGridFilterControl.

    Declaration
    public AdvancedFilterType AdvancedFilterType { get; set; }
    Property Value
    Type Description
    AdvancedFilterType

    One of the AdvancedFilterType enumeration that specifies which Advanced filter type needs to be loaded. The default value is TextFilter.

    AllowBlankFilters

    Gets or sets a value indicating whether to allow the blank filters.

    Declaration
    public bool AllowBlankFilters { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is true.

    Remarks

    In TreeGridCheckBoxFilterControl you can filter the null values by using the Blanks checkbox. You can filter the Null and NotNull values from the underlying data source by using this property in TreeGridAdvancedFilterControl.

    AscendingSortString

    Gets or sets the text content to the AscendingSortButton in TreeGridFilterControl.

    Declaration
    public string AscendingSortString { get; set; }
    Property Value
    Type Description
    System.String

    A string that specifies the AscendingSortString of TreeGridFilterControl. The default value is string.Empty.

    Remarks

    The value of AscendingSortString is updated from GridLocalizationResources by using the key SortStringAscending.

    Examples
    this.treeGrid.FilterItemsPopulating += treeGrid_FilterItemsPopulating;
    
    void treeGrid_FilterItemsPopulating(object sender, Syncfusion.UI.Xaml.Grid.TreeGridFilterItemsPopulatingEventArgs e)
    {
         if (e.Column.MappingName == "OrderID")
         {
            e.FilterControl.AscendingSortString = GridLocalizationResourceAccessor.Instance.GetLocalizedStringResource("SortStringAscending");
            e.FilterControl.DescendingSortString = GridLocalizationResourceAccessor.Instance.GetLocalizedStringResource("SortStringDescending"); 
         }
    }

    CheckBoxFilterStyle

    Gets or sets the style that is applied to the TreeGridCheckBoxFilterControl.

    Declaration
    public Style CheckBoxFilterStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style which is applied to the TreeGridCheckBoxFilterControl. The default value is null.

    Remarks

    To define a Microsoft.UI.Xaml.Style for a CheckboxFilter, specify a TargetType of TreeGridCheckBoxFilterControl.

    Examples
    <Grid.Resources>
        <Style x:Key="checkboxfilterstyleforEmployeeID" BasedOn="{StaticResource CheckboxFilterControlStyle}" TargetType="treeGrid:TreeGridCheckBoxFilterControl">
            <Setter Property="Background" Value="Red" />
        </Style>
        <Style x:Key="popupstyleforEmployeeID" BasedOn="{StaticResource GridFilterControlStyle}" TargetType="treeGrid:TreeGridFilterControl">
            <Setter Property="CheckboxFilterStyle" Value="{StaticResource checkboxfilterstyleforEmployeeID}" />
        </Style>
    </Grid.Resources>
      <treeGrid:SfTreeGrid Name="sfTreeGrid" ChildPropertyName="ReportsTo" AutoGenerateColumns="False" ItemsSource="{Binding Employees}" ParentPropertyName="ID" SelfRelationRootValue="-1" >                   
           <treeGrid:SfTreeGrid.Columns>
            <treeGrid:TreeGridTextColumn MappingName = "EmployeeID" FilterPopupStyle="{StaticResource popupstyleforEmployeeID}" AllowFiltering="True"/>
        </treeGrid:SfTreeGrid.Columns>
    </treeGrid:SfTreeGrid>

    Column

    Gets or sets the column.

    Declaration
    public TreeGridColumn Column { get; set; }
    Property Value
    Type Description
    TreeGridColumn

    DescendingSortString

    Gets or sets the text content to the DescendingSortButton in TreeGridFilterControl.

    Declaration
    public string DescendingSortString { get; set; }
    Property Value
    Type Description
    System.String

    A string that specifies DescendingSortString of TreeGridFilterControl. The default value is string.Empty.

    Remarks

    The value of DescendingSortString is updated from GridLocalizationResources by using the key SortStringDescending.

    FilterColumnType

    Gets or sets a value that indicates the FilterColumnType in TreeGridFilterControl.Which is used to show the text content of the AdvancedFilterButton in TreeGridFilterControl.

    Declaration
    public string FilterColumnType { get; set; }
    Property Value
    Type Description
    System.String

    FilterColumnType is used to show which type of AdvancedFilter is loaded in TreeGridFilterControl.The default value of FilterColumnType is TextFilters.

    Remarks

    Whenever the AdvancedFilterType property is changed at that time the FilterColumnType is also gets updated to show the AdvancedFilterType text in AdvancedFilterButton.

    FilteredFrom

    Gets or sets a value that indicates whether the column is filtered from CheckboxFilter or AdvancedFilter or FilterRow.

    Declaration
    public FilteredFrom FilteredFrom { get; set; }
    Property Value
    Type Description
    FilteredFrom

    One of the FilteredFrom enumeration that specifies the FilteredFrom. The default value of filtered from is None.

    FilterMode

    Gets or sets a value that specifies the FilterMode in TreeGridFilterControl.

    Declaration
    public FilterMode FilterMode { get; set; }
    Property Value
    Type Description
    FilterMode

    One of the FilterMode enumeration that specifies the FilterMode in SfTreeGrid. The default value of the filter mode is Both.

    Examples
    <Grid.Resources>
        <Style TargetType="treeGrid:TreeGridFilterControl" x:Key="gridFilterControlStyle">
            <Setter Property="FilterMode" Value="AdvancedFilter"/>
        </Style>
    </Grid.Resources>
    <treeGrid:SfTreeGrid x:Name="sfTreeGrid"
                         FilterPopupStyle="{StaticResource  gridFilterControlStyle}"                
                         ItemsSource="{Binding Employees}"/>

    FilterPopupHeight

    Gets or sets the height for the filter popup.

    Declaration
    public double FilterPopupHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 450.00d

    Examples
    <Grid.Resources>
        <Style TargetType="treeGrid:TreeGridFilterControl" x:Key="gridFilterControlStyle">
            <Setter Property="FilterPopupHeight" Value="300"/>
            <Setter Property="FilterPopupWidth" Value="250"/>
        </Style>
    </Grid.Resources>
    <treeGrid:SfTreeGrid x:Name="sfTreeGrid"
                         FilterPopupStyle="{StaticResource  gridFilterControlStyle}"                
                         ItemsSource="{Binding Employees}"/>

    FilterPopupWidth

    Gets or sets width for filter popup.

    Declaration
    public double FilterPopupWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 300.00d

    Examples
    <Grid.Resources>
        <Style TargetType="treeGrid:TreeGridFilterControl" x:Key="gridFilterControlStyle">
            <Setter Property="FilterPopupHeight" Value="300"/>
            <Setter Property="FilterPopupWidth" Value="250"/>
        </Style>
    </Grid.Resources>
    <treeGrid:SfTreeGrid x:Name="sfTreeGrid"
                         FilterPopupStyle="{StaticResource  gridFilterControlStyle}"                
                         ItemsSource="{Binding Employees}"/>

    HorizontalOffset

    Gets or sets HorizontalOffset for the filter popup.

    Declaration
    public double HorizontalOffset { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 0d

    ImmediateUpdateColumnFilter

    Gets or sets a value that indicates the ImmediateUpdateColumnFilter.

    Declaration
    public bool ImmediateUpdateColumnFilter { get; set; }
    Property Value
    Type Description
    System.Boolean

    The default value is false.

    Remarks

    You can filter the data immediately from the filter popup. For example you can filter the data from TreeGridCheckBoxFilterControl by check and uncheck the checkbox items. And DoneButton will be shown instead of OkButton,CancelButton in the filter popup while enable the ImmediateUpdateColumnFilter.

    IsAdvancedFilterVisible

    Gets or sets a value that indicates whether the AdvancedFilter is visible or not.

    Declaration
    public bool IsAdvancedFilterVisible { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if AdvancedFilter is visible; otherwise,false. The default value is false.

    IsOpen

    Gets or sets a value that indicates whether the filter popup is opened or not.

    Declaration
    public bool IsOpen { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the filter popup is opened; otherwise, false. The default value is false.

    ResizingThumbVisibility

    Gets or sets a value that indicates the ResizingThumb Visibility.

    Declaration
    public Visibility ResizingThumbVisibility { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Visibility

    One of the Microsoft.UI.Xaml.Visibility enumeration that specifies the visibility of ResizingThumb. The default value of ResizingThumb Visibility is Microsoft.UI.Xaml.Visibility.Visible.

    SortOptionVisibility

    Declaration
    public Visibility SortOptionVisibility { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Visibility

    VerticalOffset

    Gets or sets the VerticalOffset for filter popup.

    Declaration
    public double VerticalOffset { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 0d

    Methods

    Dispose()

    Disposes all the resources used by the TreeGridFilterControl class.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Disposes all the resources used by the TreeGridFilterControl class.

    Declaration
    protected virtual void Dispose(bool isDisposing)
    Parameters
    Type Name Description
    System.Boolean isDisposing

    Indicates whether the call is from Dispose method or from a finalizer.

    GetFormattedString(Object)

    Gets the formatted string for the actual value of the corresponding record in the filter column.

    Declaration
    public string GetFormattedString(object item)
    Parameters
    Type Name Description
    System.Object item

    Which holds the actual value of the corresponding record in the filter column.

    Returns
    Type Description
    System.String

    Returns the formatted string for the actual value of the corresponding record in the filter column.

    OnApplyTemplate()

    Builds the visual tree for the TreeGridFilterControl when a new template is applied.

    Declaration
    protected override void OnApplyTemplate()

    OnKeyDown(KeyRoutedEventArgs)

    Called before the KeyDown event occurs.

    Declaration
    protected override void OnKeyDown(KeyRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.KeyRoutedEventArgs e

    Microsoft.UI.Xaml.Input.KeyRoutedEventArgs instance that contains event data.

    OnPointerMoved(PointerRoutedEventArgs)

    Called before the PointerMoved event occurs.

    Declaration
    protected override void OnPointerMoved(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    instance that contains event data.

    Events

    PropertyChanged

    Occurs when a property value changes.

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler

    Implements

    System.IDisposable
    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved