Data Providers

The CollectionView class relies on a sourceCollection that contains an array of data items. This collection is typically populated with http requests that retrieve data from a server.

In some cases, it may be advantageous to extend the CollectionView class in order to take advantage of functionality exposed by the server. For example, C1 MVC includes a RemoteCollectionView that can use the result objects from the data service as data sources, and in addition to full CRUD support and real-time updates you automatically get CollectionView features including sorting, filtering, paging, grouping, and editing.

1
2
3
4
5
6
7
8
9
10
11
12
13
using System.Web.Mvc;
 
namespace LearnMvcClient.Controllers
{
    public partial class C1MvcController : Controller
    {
        // GET: CVDataProviders
        public ActionResult CVDataProviders()
        {
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
<h1>
    @Html.Raw(Resources.C1Mvc.CVDataProviders_Title)
</h1>
<p>
    @Html.Raw(Resources.C1Mvc.CVDataProviders_Text1)
</p>
<p>
    @Html.Raw(Resources.C1Mvc.CVDataProviders_Text2)
</p>