# C1.Win.FlexGrid.Column.AllowFiltering

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_Column_AllowFiltering_" data-uid="C1.Win.FlexGrid.Column.AllowFiltering*">AllowFiltering Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_Column_AllowFiltering_" data-uid="C1.Win.FlexGrid.Column.AllowFiltering*"></a>
<h4 id="C1_Win_FlexGrid_Column_AllowFiltering" data-uid="C1.Win.FlexGrid.Column.AllowFiltering">AllowFiltering</h4>
<div class="markdown level1 summary"><p>Gets or sets this type of filter to use for this column.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public AllowFiltering AllowFiltering { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property AllowFiltering As AllowFiltering</code></pre>
</div>
<h5 id="C1_Win_FlexGrid_Column_AllowFiltering_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The grid has an <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.AllowFiltering.html#C1_Win_FlexGrid_C1FlexGridBase_AllowFiltering">AllowFiltering</a> 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 <a class="xref" href="C1.Win.FlexGrid.Column.AllowFiltering.html#C1_Win_FlexGrid_Column_AllowFiltering">AllowFiltering</a>
property.</p>
<p>The grid provides condition and value filters. Condition filters allow users to specify
conditions such as 'value &gt; 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.</p>
</div>
<h5 id="C1_Win_FlexGrid_Column_AllowFiltering_examples">Examples</h5>
<p>The code below customizes the filters for two columns. The &quot;ShipRegion&quot; column is initialized to
show only two states, AK and CA. The &quot;UnitPrice&quot; column is initialized to show only items with
unit price greater than $30. After the column filters have been initialized, the code calls the
<a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.ApplyFilters.html#C1_Win_FlexGrid_C1FlexGridBase_ApplyFilters">ApplyFilters()</a> method to apply the filters.</p>
<pre><code class="lang-csharp">// 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();</code></pre>

</div>
