@model IEnumerable<FlexGridData.Sale>

<h1>
    Loading Data
</h1>

<p>
    Loading data into a <b>CollectionView</b> is straightforward.
</p>

<h3>
    Loading on the Client
</h3>
<p>
    If you already have the data in an array, you can use that
    array as a constructor parameter, or set the <b>sourceCollection</b>
    property to that array:
</p>
<ul id="firstList"></ul>

<h3>
    Loading from the Server
</h3>
<p>
    If the data is on a server, you can retrieve it by using the
    <b>httpRequest</b> method. When you get a response from
    the server, set the <b>sourceCollection</b> array to the
    response value or append new data to the
    <b>sourceCollection</b> array:
</p>
<ul id="secondList"></ul>

<h3>Construct in Server</h3>
<p>
    The server side CollectionViewService control constructs
    a client side CollectionView instance. You can get the
    instance by
    <a href="http://helpcentral.componentone.com/nethelp/c1mvchelpers/c1.Module.html#getService" target="_blank">c1.getService</a>
    method.
</p>
@Html.C1().CollectionViewService().Id("collectionView").Bind(Model)
<ul id="thirdList"></ul>

<p>
    If your data service API supports commands such as filtering,
    sorting, and paging, you can add parameters to your
    <b>httpRequest</b> calls to support these features. You can even
    encapsulate the server API into a custom class that extends
    <b>CollectionView</b>.
</p>