Class RadFilterView
Displays a hierarchical collection of filter options that can be used to filter data sources and controls.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Data Controls")]
public class RadFilterView : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Remarks
RadFilterView provides an interactive interface for building complex filter expressions. It can automatically generate filter categories based on data source properties or display manually configured filters. The control supports various filter types including text, numeric, boolean, date/time, and dropdown filters. It can be associated with data-bound controls to provide filtering capabilities.
Constructors
RadFilterView()
Properties
AssociatedControl
Gets or sets the control that will be filtered by this RadFilterView.
Declaration
public IFilterable AssociatedControl { get; set; }
Property Value
IFilterable
|
Remarks
When set, the filter view will automatically apply filter descriptors to the associated control's FilterDescriptors collection. The associated control must implement the IFilterable interface.
AutoGenerateCategories
Gets or sets a value indicating whether to automatically generate filter categories when the DataSource property is set.
Declaration
public bool AutoGenerateCategories { get; set; }
Property Value
System.Boolean
|
Remarks
When true, the filter view will examine the data source properties and create appropriate filter categories automatically. When false, categories must be manually added to the Categories collection.
Categories
Gets the collection of filter categories displayed in the filter view.
Declaration
public RadItemOwnerGenericCollection<BaseFilterViewCategoryElement> Categories { get; }
Property Value
RadItemOwnerGenericCollection<BaseFilterViewCategoryElement>
|
Remarks
Categories represent different filter criteria that can be applied to the data. Each category corresponds to a data field and provides appropriate filtering UI based on the data type.
CategoriesFactory
Gets or sets the factory responsible for creating category elements.
Declaration
public FilterViewCategoriesFactory CategoriesFactory { get; set; }
Property Value
FilterViewCategoriesFactory
|
Remarks
The factory determines how filter categories are created based on data types and properties. Custom factories can be used to provide specialized filtering UI for specific data types.
DataSource
Gets or sets the data source for automatic category generation.
Declaration
public object DataSource { get; set; }
Property Value
System.Object
|
Remarks
When a data source is assigned and AutoGenerateCategories is true, the filter view will automatically generate filter categories based on the data source properties. The data source can be any enumerable collection, DataTable, or data-bound object.
DefaultSize
Gets the default size of the control.
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
Expression
Gets the current filter expression as a string representation.
Declaration
public string Expression { get; }
Property Value
System.String
|
Remarks
The expression represents the combined filter criteria from all active categories in a format that can be used with expression parsers or for display purposes.
FilterDescriptors
Gets the collection of filter descriptors that represent the current filter state.
Declaration
public FilterDescriptorCollection FilterDescriptors { get; }
Property Value
FilterDescriptorCollection
|
Remarks
Filter descriptors contain the actual filtering logic including field names, operators, and values. These descriptors can be applied to data sources or controls that support filtering.
FilteringMode
Gets or sets the filtering mode that determines when filters are applied.
Declaration
public FilteringMode FilteringMode { get; set; }
Property Value
FilteringMode
|
Remarks
OnFilterChanged applies filters immediately when they are changed. Other modes may require explicit action to apply the filters.
FilterViewElement
Gets the main FilterViewElement that contains all the filtering functionality.
Declaration
public RadFilterViewElement FilterViewElement { get; }
Property Value
RadFilterViewElement
|
LoadCategoriesAsync
Gets or sets a value indicating whether category elements are generated asynchronously.
Declaration
public bool LoadCategoriesAsync { get; set; }
Property Value
System.Boolean
|
Remarks
Asynchronous loading improves UI responsiveness when working with large data sources by generating filter categories on a background thread.
RadContextMenu
Gets or sets the context menu displayed when right-clicking on filter categories.
Declaration
public virtual RadContextMenuDropDown RadContextMenu { get; set; }
Property Value
RadContextMenuDropDown
|
Remarks
The context menu typically provides options to clear filters, modify filter settings, or perform other filter-related actions.
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
Methods
CreateChildItems(RadElement)
Creates the child elements of the control.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
RadElement
parent
The parent element to which the child elements will be added. |
Overrides
CreateFilterViewElement()
Creates the main filter view element.
Declaration
protected virtual RadFilterViewElement CreateFilterViewElement()
Returns
RadFilterViewElement
A new instance of RadFilterViewElement. |
Events
CategoryCreated
An event that occurs when a category is created and populated with items.
Declaration
public event FilterViewCategoryCreatedEventHandler CategoryCreated
Event Type
FilterViewCategoryCreatedEventHandler
|
Remarks
This event is suitable for modifying properties of the category element after it has been created and populated. It allows final customization of the category's appearance and behavior.
CategoryCreating
An event that occurs when a category is created and is about to be populated with items.
Declaration
public event FilterViewCategoryCreatingEventHandler CategoryCreating
Event Type
FilterViewCategoryCreatingEventHandler
|
Remarks
This event is suitable for modifying the values collection (sort/add/remove/reorder) or replacing the category element entirely. It allows customization of the category before it becomes visible to the user.
ContextMenuClosed
Occurs when the context menu is closed.
Declaration
public event EventHandler ContextMenuClosed
Event Type
System.EventHandler
|
Remarks
This event is raised after the context menu has been closed and is no longer visible to the user.
ContextMenuClosing
Occurs when the context menu is closing.
Declaration
public event CancelEventHandler ContextMenuClosing
Event Type
System.ComponentModel.CancelEventHandler
|
Remarks
This event allows handling of context menu closing and optionally preventing the closure. Set the Cancel property of the event arguments to prevent the menu from closing.
ContextMenuItemClick
Occurs when an item in the context menu is clicked.
Declaration
public event HandledEventHandler ContextMenuItemClick
Event Type
System.ComponentModel.HandledEventHandler
|
Remarks
This event allows custom handling of context menu actions before the default processing occurs. Set the Handled property of the event arguments to prevent default processing.
ContextMenuOpened
Occurs when the context menu is opened.
Declaration
public event EventHandler ContextMenuOpened
Event Type
System.EventHandler
|
Remarks
This event is raised after the context menu has been successfully opened and displayed to the user.
ContextMenuOpening
Occurs when the context menu is opening.
Declaration
public event CancelEventHandler ContextMenuOpening
Event Type
System.ComponentModel.CancelEventHandler
|
Remarks
This event allows customization of the context menu before it is displayed to the user. Set the Cancel property of the event arguments to prevent the menu from opening.
FilterChanged
Occurs when the filter is changed in any of the filter categories.
Declaration
public event FilterChangedEventHandler FilterChanged
Event Type
FilterChangedEventHandler
|
Remarks
This event is raised whenever a filter value is modified, added, or removed from any category. It provides access to the changed category and the resulting filter descriptor.