@model IEnumerable<FlexGridData.Sale>

<h1>
    CollectionView Filtering
</h1>

<p>
    Use the <b>CollectionView.filter</b> property to specify
    a filter function that defines which items should be
    included in the view.
</p>
<p>
    Choose one of the options to see it in action:
</p>

<label>
    <input type="radio" name="filter" value="" checked="true" />
    No Filter
</label>
<label>
    <input type="radio" name="filter" value="Country" />
    US only
</label>
<label>
    <input type="radio" name="filter" value="Sales" />
    Sales > 50,000
</label>
<label>
    <input type="radio" name="filter" value="Downloads" />
    Downloads > 150,000
</label>

<p>
    Result (<span id="cnt"></span> items):
</p>
@(Html.C1().FlexGrid().Id("theGrid").Height(250)
    .Bind(b=>b.Bind(Model).DisableServerRead(true))
    .AutoGenerateColumns(false)
    .Columns(cs=>
    {
        cs.Add().Binding("Id").Header("ID");
        cs.Add().Binding("Country").Header("Country");
        cs.Add().Binding("Downloads").Header("Downloads");
        cs.Add().Binding("Sales").Header("Sales");
        cs.Add().Binding("Expenses").Header("Expenses");
    })
    .ShowAlternatingRows(false)
    .HeadersVisibility(C1.Web.Mvc.Grid.HeadersVisibility.Column)
)