@model IEnumerable<FlexGridData.Sale>

<h1>
    CollectionView Editing
</h1>
<p>
    <b>CollectionView</b> provides support for editing items
    with the help of methods similar to those found in .NET's
    <b>IEditableCollectionView</b> interface:
    <b>editItem</b>, <b>commitEdit</b>, and <b>cancelEdit</b>.
</p>
<p>
    The <b>editItem</b> method saves a copy of the item and
    puts the collection in 'edit mode'. While in edit mode,
    the view is not refreshed, so items are not sorted
    or filtered out of view during the edit process.
</p>
<p>
    The <b>commitEdit</b> method exits the edit mode so that sorting
    and filtering become active again. If the item has changed,
    the <b>collectionChanged</b> event is fired to reflect the 
    changes in the bound controls.
</p>
<p>
    The <b>cancelEdit</b> method restores the original data
    and exits the edit mode.
</p>
<p>
    Edit the grid below to observe how this works. 
	</p>
<p>
    To edit the grid, double click a cell. When editing 
	starts, a pencil icon appears on the
    row header to indicate that the collection is in edit
    mode.
</p>
<p>
    To cancel the editing process, press the Escape key
    while editing and restore the original data. 
</p>
<p>
    To commit the edits, move the selection to 
    a different row, or move the focus away from the grid. 
    At this point, the collection is refreshed and any
    active filtering/sorting is applied again using the
    new values.
</p>

@(Html.C1().FlexGrid().Id("theGrid")
    .Bind(Model)
)