[]
Provides extension methods to support grid and column filtering.
public static class FilterExtensionMethods
<p>The extension methods are optional. They are useful for simplifying
the syntax and making applications easier to read.
For example, the code below uses the standard syntax to enable filtering on a grid and to customize the first two column filters:
<pre><code class="lang-csharp">// enable filtering using regular syntax
var gridFilter = new C1FlexGridFilter(flex);
// disable the filter on column 0
var cf = gridFilter.GetColumnFilter(flex.Columns[0]);
cf.FilterType = FilterType.None;
// show a Condition filter on column 1
cf = gridFilter.GetColumnFilter(flex.Columns[1]);
cf.FilterType = FilterType.Condition;</code></pre>
<p>Using the extension methods, you could re-write this code as follows:</p>
<pre><code class="lang-csharp">// enable filtering using extension methods
flex.EnableFiltering(true);
// disable the filter on column 0
var cf = flex.Columns[0].GetColumnFilter();
cf.FilterType = FilterType.None;
// show a Value filter on column 1
var cf = flex.Columns[1].GetColumnFilter();
cf.FilterType = FilterType.Value;</code></pre>
Name | Description |
---|---|
EnableFiltering(C1FlexGrid, bool) | Extension method to enable or disable column filtering on a C1FlexGrid. |
GetColumnFilter(Column) | Extension method to get the ColumnFilter associated with a Column. |