DataFilter for WinForms | ComponentOne
C1.Win.DataFilter.4.5.2 Assembly / C1.Win.DataFilter Namespace / BoolFilter Class
Members

In This Topic
    BoolFilter Class
    In This Topic
    Represents a filter with checkbox.
    Object Model
    BoolFilter Class
    Syntax
    'Declaration
     
    Public Class BoolFilter 
       Inherits C1.DataFilter.BoolFilterBase
    public class BoolFilter : C1.DataFilter.BoolFilterBase 
    Remarks

    This class is used to instantiate a filter which can be applied to the Boolean type values. It helps to filter out the data based on their value i.e. True/False. The listing below provides the details about different options that can be set for the filter using this class.

    • Get or set the name of the data item property to which the current filter applies using the PropertyName property.
    • Set the header text of the filter using the HeaderText property and determine its visibility with the help of ShowHeader property.
    • Expand/Collapse the filter with the help of Expanded property.
    • The Text property helps to get or set the label of the checkbox.
    • Get or set the value of the current filter using the Value property.
    • Get or set the default value of the current filter with the help of DefaultValue property. This property is used with the IgnoreDefault property.
    • Determine whether the current filter applies or not when the Value and DefaultValue properties are equal with the help of IgnoreDefault property.
    • Retrieve the current filter expression with the help of Expression property.
    • The IsApplied property can be used to find whether the current filter is applied or not.
    Example

    private void InitializeBoolFilter()

    {

     //Initialize the BoolFilter
     BoolFilter boolFilter = new BoolFilter();

     //Sets the name of the data item property to which the current filter applies
     boolFilter.PropertyName = "Discontinued";

     //Sets the header text of the filter
     boolFilter.HeaderText = "Discontinued";

     //Sets the text of the label of the checkbox
     boolFilter.Text = "Discontinued";

     //Sets the value of the current filter
     boolFilter.Value = true;

     //Sets the default value of the current filter
     boolFilter.DefaultValue = true;

     //Determines whether the current filter applies or not when the Value is equal to DefaultValue
     boolFilter.IgnoreDefault = false;

     //Adds the BoolFilter to the FilterCollection
     c1DataFilter1.Filters.Add(boolFilter);

    }

    Inheritance Hierarchy

    System.Object
       C1.DataFilter.Filter
          C1.DataFilter.BoolFilterBase
             C1.Win.DataFilter.BoolFilter

    See Also