Class GridConditionalFormatDescriptor
Represents a class that provides filter criteria for displaying a subset of records from the underlying data source with conditional cell formatting.
Conditional format descriptors are managed by the GridConditionalFormatDescriptorCollection that is returned by the ConditionalFormats property of a GridTableDescriptor.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid.Grouping
Assembly: Syncfusion.Grid.Grouping.Windows.dll
Syntax
public class GridConditionalFormatDescriptor : DescriptorBase, ICustomTypeDescriptor, IDisposable, ICloneable, IGridTableCellAppearanceSource
Constructors
GridConditionalFormatDescriptor()
Initializes a new instance of the GridConditionalFormatDescriptor class.
Declaration
public GridConditionalFormatDescriptor()
GridConditionalFormatDescriptor(String)
Initializes a new instance of the GridConditionalFormatDescriptor class with a specified name.
Declaration
public GridConditionalFormatDescriptor(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the descriptor. |
Properties
Appearance
Gets or sets the default GridTableCellAppearance with default GridTableCellStyleInfo information for field cell elements in a record that matches the filter criteria specified with Expression or RecordFilters.
Declaration
public GridTableCellAppearance Appearance { get; set; }
Property Value
Type |
---|
GridTableCellAppearance |
Collection
Gets the collection this descriptor belongs to.
Declaration
public GridConditionalFormatDescriptorCollection Collection { get; }
Property Value
Type |
---|
GridConditionalFormatDescriptorCollection |
Engine
Gets the GridEngine which the conditional format descriptor belongs to.
Declaration
public GridEngine Engine { get; }
Property Value
Type |
---|
GridEngine |
Expression
Gets or sets the formula expression similar to expressions used in the ExpressionFieldDescriptor.
Declaration
public string Expression { get; set; }
Property Value
Type |
---|
System.String |
Name
Gets or sets the name of this conditional format. This name is used to look up items in the ConditionalFormats collection of the parent table descriptor.
Declaration
public virtual string Name { get; set; }
Property Value
Type |
---|
System.String |
RecordFilters
Gets the collection of RecordFilterDescriptor objects defining filter criteria for records in the table. Each RecordFilterDescriptor in the collection references one or multiple FieldDescriptor of the Fields collection. Multiple criteria can be combined with logical "And" or "Or" operations.
Declaration
public RecordFilterDescriptorCollection RecordFilters { get; }
Property Value
Type |
---|
RecordFilterDescriptorCollection |
Rules
Gets of sets the values of ConditionalFormatDataBarRuleCollection rules like IconSets , Color scale , DataBar.
Declaration
public ConditionalFormatDataBarRuleCollection Rules { get; set; }
Property Value
Type |
---|
ConditionalFormatDataBarRuleCollection |
TableDescriptor
Gets the TableDescriptor that this descriptor belongs to.
Declaration
public GridTableDescriptor TableDescriptor { get; }
Property Value
Type |
---|
GridTableDescriptor |
Methods
Clone()
Creates a copy of this descriptor.
Declaration
public GridConditionalFormatDescriptor Clone()
Returns
Type | Description |
---|---|
GridConditionalFormatDescriptor | 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. |
Dispose(Boolean)
Overrides and manages the unwanted resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
Equals(Object)
Overrides and determines a value whether the specified System.Object is equal to the current System.Object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified System.Object is equal to the current System.Object; 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. |
GetHashCode()
Gets 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()
Overrides and gets the descriptor name.
Declaration
public override string GetName()
Returns
Type | Description |
---|---|
System.String | Descriptor name. |
Overrides
GetRule(String)
Gets the rule applied on the specified column.
Declaration
public ConditionalFormatRuleBase GetRule(string column)
Parameters
Type | Name | Description |
---|---|---|
System.String | column | The column name. |
Returns
Type | Description |
---|---|
ConditionalFormatRuleBase | The rule. |
InitializeFrom(GridConditionalFormatDescriptor)
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(GridConditionalFormatDescriptor other)
Parameters
Type | Name | Description |
---|---|---|
GridConditionalFormatDescriptor | other | The source object. |
OnPropertyChanged(DescriptorPropertyChangedEventArgs)
Triggered when the PropertyChanged event is done.
Declaration
protected virtual void OnPropertyChanged(DescriptorPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DescriptorPropertyChangedEventArgs | e | A DescriptorPropertyChangedEventArgs contains the event data. |
OnPropertyChanging(DescriptorPropertyChangedEventArgs)
Triggered when the PropertyChanging event is done.
Declaration
protected virtual void OnPropertyChanging(DescriptorPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DescriptorPropertyChangedEventArgs | e | A DescriptorPropertyChangedEventArgs contains the event data. |
ResetAppearance()
Discards any changes for the Appearance object.
Declaration
public void ResetAppearance()
ResetCompiledExpression()
Resets the compiled expression. It will be recompiled later on demand.
Declaration
public void ResetCompiledExpression()
ResetRecordFilters()
Clears the RecordFilters collection.
Declaration
public void ResetRecordFilters()
ShouldSerializeAppearance()
Determines a value indicating whether the Appearance has been modified and its contents should be serialized or not at design-time.
Declaration
public bool ShouldSerializeAppearance()
Returns
Type | Description |
---|---|
System.Boolean | True if contents were changed; False otherwise. |
ShouldSerializeRecordFilters()
Determines a value indicating whether the RecordFilters collection contains values or not.
Declaration
public bool ShouldSerializeRecordFilters()
Returns
Type | Description |
---|---|
System.Boolean | True if it contains values; False otherwise. |
ToString()
Overrides and gets the string representation of the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of the current object. |
Overrides
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
IGridTableCellAppearanceSource.GetAppearance()
Gets the Grid table appearance.
Declaration
GridTableCellAppearance IGridTableCellAppearanceSource.GetAppearance()
Returns
Type | Description |
---|---|
GridTableCellAppearance | Appearance of the Grid table. |
IGridTableCellAppearanceSource.GetBaseAppearance()
Gets the base appearance of the current object.
Declaration
GridTableCellAppearance IGridTableCellAppearanceSource.GetBaseAppearance()
Returns
Type | Description |
---|---|
GridTableCellAppearance | The base appearance. |
IGridTableCellAppearanceSource.RaiseAppearanceChanged(GridTableCellStyleInfoChangedEventArgs)
Triggered when the Changed event is done.
Declaration
void IGridTableCellAppearanceSource.RaiseAppearanceChanged(GridTableCellStyleInfoChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridTableCellStyleInfoChangedEventArgs | e | The GridTableCellStyleInfoChangedEventArgs contains the event data. |
IGridTableCellAppearanceSource.RaiseAppearanceChanging(GridTableCellStyleInfoChangedEventArgs)
Triggered when the Changing event is done.
Declaration
void IGridTableCellAppearanceSource.RaiseAppearanceChanging(GridTableCellStyleInfoChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridTableCellStyleInfoChangedEventArgs | e | The GridTableCellStyleInfoChangedEventArgs contains the event data. |
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type |
---|
System.Object |