@model IEnumerable<FlexGridData.Sale>

<h1>
    Dynamic DataMaps (switch)
</h1>
<p>
    In some situations, you may want to change the data map used
    with a column depending on the value of another column.
    For example, you may want the drop-down in the 'City' column
    to show only cities in the country that is selected for the
    current row.
</p>
<p>
    If your data maps contain only array strings, then it is not
    used as a real map. The cells actually contain the strings
    stored in the grid, and in this case it is safe to switch
    data maps before editing cells.
</p>
<p>
    In the grid below, the data map used for selecting cities is
    a string array that is updated before editing the cells to
    include only cities that belong to the current country:
</p>
@(Html.C1().FlexGrid().Id("theGrid")
    .SelectionMode(C1.Web.Mvc.Grid.SelectionMode.Row)
    .AutoGenerateColumns(false)
    .Columns(cs=>
    {
        cs.Add().Binding("country").Header("Country");
        cs.Add().Binding("city").Header("City");
        cs.Add().Binding("downloads").Header("Downloads");
        cs.Add().Binding("sales").Header("Sales");
    })
)