C1.Win.C1FlexGrid Namespace > Column Class : AllowFiltering Property |
'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); }
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.
// 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();
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