FlexGrid for WinForms
AllowFiltering Property (Column)
Example 



Gets or sets this type of filter to use for this column.
Syntax
'Declaration
 
<C1CategoryAttribute("Behavior")>
<C1DescriptionAttribute("Gets or sets whether this column can be filtered.")>
<DefaultValueAttribute()>
Public Property AllowFiltering As AllowFiltering
'Usage
 
Dim instance As Column
Dim value As AllowFiltering
 
instance.AllowFiltering = value
 
value = instance.AllowFiltering
[C1Category("Behavior")]
[C1Description("Gets or sets whether this column can be filtered.")]
[DefaultValue()]
public AllowFiltering AllowFiltering {get; set;}
[C1Category("Behavior")]
[C1Description("Gets or sets whether this column can be filtered.")]
[DefaultValue()]
public:
property AllowFiltering AllowFiltering {
   AllowFiltering get();
   void set (    AllowFiltering value);
}
Remarks

The grid has an C1FlexGridBase.AllowFiltering property that determines whether columns can be filtered by the user. If that property is set to true, then filters are created automatically for each column based on the setting of the column's AllowFiltering property.

The grid provides condition and value filters. Condition filters allow users to specify conditions such as 'value > 10'. Value filters allow users to select values that should be displayed from a list of values present in the data source. All filters can be customized in code as shown in the examples below.

Example
The code below customizes the filters for two columns. The "ShipRegion" column is initialized to show only two states, AK and CA. The "UnitPrice" column is initialized to show only items with unit price greater than $30. After the column filters have been initialized, the code calls the C1FlexGridBase.ApplyFilters method to apply the filters.
// initialize "ShipRegion" column filter to show only two values: "AK" and "CA"
var col = _flex.Cols["ShipRegion"];
col.AllowFiltering = AllowFiltering.ByValue;
var vf = col.Filter as ValueFilter;
vf.ShowValues = new object[] { "AK", "CA" };
            
// initialize "UnitPrice" column filter to show only values greater than $30
col = _flex.Cols["UnitPrice"];
col.AllowFiltering = AllowFiltering.ByCondition;
var cf = col.Filter as ConditionFilter;
cf.Condition1.Operator = ConditionOperator.GreaterThan;
cf.Condition1.Parameter = 30;
            
// apply both column filters to the data
_flex.ApplyFilters();
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Column Class
Column Members

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback