Class RecordFilterDescriptor
Represents a class for RecordFilterDescriptor that provides filter criteria for displaying only a subset of records from the underlying datasource. A filter can be specified through a collection of FilterCondition elements or with a formula expression similar to expressions used in ExpressionFieldDescriptor.
RecordFilterDescriptors are managed by the RecordFilterDescriptorCollection that is returned by the RecordFilters property of a TableDescriptor.
Implements
Inherited Members
Namespace: Syncfusion.Grouping
Assembly: Syncfusion.Grouping.Base.dll
Syntax
public class RecordFilterDescriptor : DescriptorBase, ICustomTypeDescriptor, IDisposable, ICloneable, IStandardValuesProvider
Constructors
RecordFilterDescriptor()
Initializes a new empty filter.
Declaration
public RecordFilterDescriptor()
RecordFilterDescriptor(String)
Initializes a new filter based on a formula expression similar to expressions used in ExpressionFieldDescriptor.
Declaration
public RecordFilterDescriptor(string expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | expression | A formula expression similar to expressions used in ExpressionFieldDescriptor. |
RecordFilterDescriptor(String, FilterCondition)
Initializes a new filter based on a collection of FilterCondition.
Declaration
public RecordFilterDescriptor(string name, FilterCondition condition)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the field this filter is compared with. This name is used to look up fields in the Fields collection of the parent table descriptor. |
| FilterCondition | condition | The condition. |
RecordFilterDescriptor(String, FilterLogicalOperator, FilterCondition[])
Initializes a new filter based on a collection of FilterCondition.
Declaration
public RecordFilterDescriptor(string name, FilterLogicalOperator logicalOperator, FilterCondition[] conditions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the field this filter is compared with. This name is used to look up fields in the Fields collection of the parent table descriptor. |
| FilterLogicalOperator | logicalOperator | The logical operator used if multiple conditions are given. |
| FilterCondition[] | conditions | The collection of conditions. |
RecordFilterDescriptor(String, String)
Initializes a new filter based on a formula expression similar to expressions used in ExpressionFieldDescriptor.
Declaration
public RecordFilterDescriptor(string name, string expression)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the field this filter is compared with. This name is used to look up fields in the Fields collection of the parent table descriptor. |
| System.String | expression | A formula expression similar to expressions used in ExpressionFieldDescriptor. |
RecordFilterDescriptor(String, String, FilterCondition)
Initializes a new filter based on a collection of FilterCondition.
Declaration
public RecordFilterDescriptor(string name, string mappingName, FilterCondition condition)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the field descriptor. |
| System.String | mappingName | The name of the field this filter is compared with. This name is used to look up fields in the Fields collection of the parent table descriptor. |
| FilterCondition | condition | The condition. |
RecordFilterDescriptor(String, String, FilterLogicalOperator, FilterCondition[])
Initializes a new filter based on a collection of FilterCondition.
Declaration
public RecordFilterDescriptor(string name, string mappingName, FilterLogicalOperator logicalOperator, FilterCondition[] conditions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the field descriptor. |
| System.String | mappingName | The name of the field this filter is compared with. This name is used to look up fields in the Fields collection of the parent table descriptor. |
| FilterLogicalOperator | logicalOperator | The logical operator used if multiple conditions are given. |
| FilterCondition[] | conditions | The collection of conditions. |
Properties
Collection
The collection this descriptor belongs to.
Declaration
public RecordFilterDescriptorCollection Collection { get; }
Property Value
| Type |
|---|
| RecordFilterDescriptorCollection |
Conditions
The collection of filter conditions.
Declaration
public FilterConditionCollection Conditions { get; }
Property Value
| Type |
|---|
| FilterConditionCollection |
Expression
A formula expression similar to expressions used in ExpressionFieldDescriptor.
Declaration
public string Expression { get; set; }
Property Value
| Type |
|---|
| System.String |
FieldDescriptor
Gets the field descriptor this record filter is applied to.
Declaration
public FieldDescriptor FieldDescriptor { get; }
Property Value
| Type |
|---|
| FieldDescriptor |
FilterDisplay
Used internally.
Declaration
public virtual ArrayList FilterDisplay { get; set; }
Property Value
| Type |
|---|
| System.Collections.ArrayList |
Format
Gets or sets the format string. This is used to check the Format while filtering.
Declaration
public string Format { get; set; }
Property Value
| Type |
|---|
| System.String |
LogicalOperator
The logical operator used if multiple conditions are given.
Declaration
public FilterLogicalOperator LogicalOperator { get; set; }
Property Value
| Type |
|---|
| FilterLogicalOperator |
MappingName
The name of the field this filter is compared with. This name is used to look up fields in the Fields collection of the parent table descriptor.
Declaration
public virtual string MappingName { get; set; }
Property Value
| Type |
|---|
| System.String |
Name
The name of this filter descriptor or the name of the field this filter is compared with.
Declaration
public virtual string Name { get; set; }
Property Value
| Type |
|---|
| System.String |
TableDescriptor
The TableDescriptor that this descriptor belongs to.
Declaration
public TableDescriptor TableDescriptor { get; }
Property Value
| Type |
|---|
| TableDescriptor |
UniqueGroupId
A UniqueGroupId category the filter belongs to. This property is used by FilterBar to identify the conditions that only belong to a certain uniqueGroupId. All RecordFilter objects that have the same UniqueGroupId will be combined with LogicalOperator.And.
Declaration
public object[] UniqueGroupId { get; set; }
Property Value
| Type |
|---|
| System.Object[] |
Methods
Clone()
Creates a copy of this descriptor and all its conditions.
Declaration
public virtual RecordFilterDescriptor Clone()
Returns
| Type | Description |
|---|---|
| RecordFilterDescriptor | A copy of this descriptor. |
CompareRecord(Record)
Evaluates this filter for the given record and returns True if the record meets the filters criteria.
Declaration
public bool CompareRecord(Record record)
Parameters
| Type | Name | Description |
|---|---|---|
| Record | record | The record to be evaluated. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the record meets the filters criteria; False otherwise. |
CompareRecordFilterBar(Record, FieldDescriptor)
Evaluates this condition for the given record and returns True if the record meets the condition.
Declaration
public bool CompareRecordFilterBar(Record record, FieldDescriptor filterBarFieldDescriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| Record | record | The record to be evaluated. |
| FieldDescriptor | filterBarFieldDescriptor | If the underlying FilterDescriptor of this condition is the same as filterBarFieldDescriptor, this method will return True. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the record meets the condition; False otherwise. |
CompareUniqueId(Object[])
Compares the specified Group.UniqueGroupId with this record filters RecordFilterDescriptor.UniqueGroupId. The method is used by FilterBarCells to find the filter criteria that matches the child group that a filter bar belongs to.
Declaration
public bool CompareUniqueId(object[] uniqueId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object[] | uniqueId | A Group.UniqueGroupID to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if both UniqueGroupID are equal.; False otherwise. |
CopyAllMembersTo(RecordFilterDescriptor)
Copy all the members.
Declaration
protected void CopyAllMembersTo(RecordFilterDescriptor rd)
Parameters
| Type | Name | Description |
|---|---|---|
| RecordFilterDescriptor | rd | An instance of the RecordFilterDescriptor class. |
CreateFilterConditionCollection(FilterCondition[])
Creates the FilterConditionCollection list.
Declaration
protected virtual FilterConditionCollection CreateFilterConditionCollection(FilterCondition[] conditions)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterCondition[] | conditions |
Returns
| Type | Description |
|---|---|
| FilterConditionCollection | Returns a new instance of FilterConditionCollection. |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Overrides
Equals(Object)
Determines whether the specified descriptor object is equal to the current descriptor.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | The descriptor object to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the specified descriptor is equal to the current descriptor; otherwise, false. |
Overrides
GetCompiledExpression()
Gets a string that holds pre-compiled information about the expression.
Declaration
public string GetCompiledExpression()
Returns
| Type | Description |
|---|---|
| System.String | A string that holds pre-compiled information about the expression. |
GetCustomPDC(PropertyDescriptorCollection)
Used to represents the collection of property descriptor.
Declaration
protected override PropertyDescriptorCollection GetCustomPDC(PropertyDescriptorCollection baseprops)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.PropertyDescriptorCollection | baseprops | An instance of the System.ComponentModel.PropertyDescriptorCollection class. |
Returns
| Type | Description |
|---|---|
| System.ComponentModel.PropertyDescriptorCollection | An instance of the System.ComponentModel.PropertyDescriptorCollection class. |
Overrides
GetHashCode()
Serves as a hash function for a particular type.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | A hash code for the current object. |
Overrides
GetName()
Gets the descriptor name.
Declaration
public override string GetName()
Returns
| Type | Description |
|---|---|
| System.String | Descriptor name. |
Overrides
InitializeFrom(RecordFilterDescriptor)
Initializes this object and copies properties from another object. PropertyChanging and PropertyChanged events are raised for every property that is modified. If both objects are equal, no events are raised.
Declaration
public void InitializeFrom(RecordFilterDescriptor other)
Parameters
| Type | Name | Description |
|---|---|---|
| RecordFilterDescriptor | other | The source object. |
OnPropertyChanged(DescriptorPropertyChangedEventArgs)
Raises the PropertyChanged event.
Declaration
protected virtual void OnPropertyChanged(DescriptorPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DescriptorPropertyChangedEventArgs | e | A DescriptorPropertyChangedEventArgs that contains the event data. |
OnPropertyChanging(DescriptorPropertyChangedEventArgs)
Raises the PropertyChanging event.
Declaration
protected virtual void OnPropertyChanging(DescriptorPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DescriptorPropertyChangedEventArgs | e | A DescriptorPropertyChangedEventArgs that contains the event data. |
ResetCompiledExpression()
Resets the compiled expression. It will be recompiled later on demand.
Declaration
public void ResetCompiledExpression()
ResetMappingName()
Resets the name to be empty.
Declaration
public void ResetMappingName()
ResetName()
Resets the name to be empty.
Declaration
public void ResetName()
ResetUniqueGroupId()
Resets the UniqueGroupId to null.
Declaration
public void ResetUniqueGroupId()
ShouldSerializeConditions()
Determines if filter conditions were added.
Declaration
public bool ShouldSerializeConditions()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if filter conditions were added; False otherwise. |
ShouldSerializeMappingName()
Determines if name is not empty.
Declaration
public bool ShouldSerializeMappingName()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the name is not empty. |
ShouldSerializeName()
Determines if name is not empty.
Declaration
public bool ShouldSerializeName()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if name is not empty; False otherwise. |
ShouldSerializeUniqueGroupId()
Determines if UniqueGroupId should be serialized to code or XML.
Declaration
public bool ShouldSerializeUniqueGroupId()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if UniqueGroupId should be serialized; False otherwise. |
Events
PropertyChanged
Occurs when a property is changed.
Declaration
public event DescriptorPropertyChangedEventHandler PropertyChanged
Event Type
| Type |
|---|
| DescriptorPropertyChangedEventHandler |
PropertyChanging
Occurs before a property is changed.
Declaration
public event DescriptorPropertyChangedEventHandler PropertyChanging
Event Type
| Type |
|---|
| DescriptorPropertyChangedEventHandler |
Explicit Interface Implementations
IStandardValuesProvider.GetStandardValues(PropertyDescriptor)
Declaration
ICollection IStandardValuesProvider.GetStandardValues(PropertyDescriptor pd)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.PropertyDescriptor | pd |
Returns
| Type |
|---|
| System.Collections.ICollection |
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
| Type |
|---|
| System.Object |