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

In This Topic
    ChecklistFilter Class
    In This Topic
    Represents a filter with checklist.
    Object Model
    ChecklistFilter Class
    Syntax
    'Declaration
     
    Public Class ChecklistFilter 
       Inherits C1.DataFilter.ChecklistFilterBase
    public class ChecklistFilter : C1.DataFilter.ChecklistFilterBase 
    Remarks

    This class is used to instantiate a filter which can be applied to the string/number/date type values. It displays a list of items and filters out the data based on the items selected in the list. 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 auto generated CheckListFilter does not have any items, you can specify the items source for the checklist using the ItemsSource property.
    • Set the of ValueMemberPath and DisplayMemberPath properties to a data field in the ItemsSource to provide the actual values and display values for the checklist items respectively.
    • Specify the layout type (Flow/List) for the checklist using the LayoutType property.
    • Get or set the maximum height of the checklist with the help of MaxHeight property.
    • Specify the selection mode(Single/Multiple) for the checklist items using the SelectionMode property and get the collection of selected values with the help of SelectedItems property.
    • Display/Hide the search box used to search values in the checklist using the ShowSearchBox property.
    • Show/Hide the “Select All” checkbox at the top of the checklist using the ShowSelectAll property.
    • Specify the number of items to be displayed in the checklist with the help of DisplayedItems property.
    • Select/Unselect all the checklist items using the SelectAll and UnselectAll methods.
    • 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 InitializeChecklistFilter()

    {

     //Initialize the ChecklistFilter
     ChecklistFilter checklistFilter = new ChecklistFilter();

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

     //Sets the ItemsSource for the ChecklistFilter
     checklistFilter.ItemsSource = _carsTable;

     //Specify the path of the data field in the ItemsSource which provides the actual values
     //for the checklist items.
     checklistFilter.ValueMemberPath = "Brand";

     //Sets the header text of the filter
     checklistFilter.HeaderText = "Brand";

     //Sets the layout type of the checklist
     checklistFilter.LayoutType = C1.DataFilter.LayoutType.List;

     //Sets the selection method for items of the checklist
     checklistFilter.SelectionMode = C1.DataFilter.SelectionMode.Multiple;

     //Shows the search box
     checklistFilter.ShowSearchBox = true;

     //Sets the count to items displayed in the checklist
     checklistFilter.DisplayedItems = 5;

     //Selects all the checklist items
     checklistFilter.SelectAll();

     //Adds the ChecklistFilter to the FilterCollection
     c1DataFilter1.Filters.Add(checklistFilter);

    }

    Inheritance Hierarchy

    System.Object
       C1.DataFilter.Filter
          C1.DataFilter.FilterWithSummary
             C1.DataFilter.ChecklistFilterBase
                C1.Win.DataFilter.ChecklistFilter

    See Also