@using FilterPanel.Models
@using C1.Web.Mvc.Grid

@model IEnumerable<Sale>
@{
    ViewBag.Title = "FilterPanel";
}

<div class="container">
    <h1>
        FilterPanel
    </h1>
    <p>
        This sample defines a <b>FilterPanel</b> that shows currently
        active filters and allows users to remove filters by clicking.
    </p>
</div>
<p>
    Add or change filters to see how they are added to the
    <b>FilterPanel</b> above the grid.
</p>
<p>
    Click the 'x' icons in the filter markers to remove one
    or all filters.
</p>
<div id="filterPanel"></div>

@(Html.C1().FlexGrid<Sale>()
    .Id("grid")
    .AutoGenerateColumns(false)
    .Bind(Model)
    .IsReadOnly(true)
    .Columns(columns =>
    {
        columns.Add(column => column.Binding("ID").Width("0.3*"));
        columns.Add(column => column.Binding("Active").Width("0.3*"));
        columns.Add(column => column.Binding("Country").Width("*"));
        columns.Add(column => column.Binding("Product").Width("*"));
        columns.Add(column => column.Binding("Start").Width("*"));
    })
    .SelectionMode(SelectionMode.Row)
    .AllowSorting(true)
    .Filterable(f => f.DefaultFilterType(FilterType.Both).Id("gridFilter"))
)