ScrollView Overview

The ScrollView HtmlHelper extension is a server-side wrapper for the Kendo UI ScrollView widget.

It displays a horizontal collection of content or image views with built-in navigation between them. It can be scrolled via dragging, gestures, arrow click or page click or tap.

Key Features

The Kendo UI ScrollView:

  • Can be initialized with HTML only.
  • Features data-source binding.
  • Has a customizable template.
  • Provides a built-in pager.
  • Allows you to programmatically scroll to a specific page through its API methods.
  • Has adjustable bounce effects and scroll velocity.
  • Allows you to capture user interactions by handling the events that are triggered by the widget.

Getting Started

You can initialize the ScrollView either from HTML or from a data source with a template.

Initialize the ScrollView from HTML

To initialize the Kendo UI ScrollView from HTML:

  1. Use its Items() method.
  2. Add HTML elements for each page as part of the content of the ScrollView items.
    h1 {
        margin-top: 30%;
        .Items(x =>
        .HtmlAttributes(new { style = "height:748px; width:1022px; max-width: 100%;" })

Initialize the ScrollView with a Data Source and a Template

To initialize the Kendo UI ScrollView with a Data Source and a template:

  1. Create a Kendo UI template.
  2. Use the TemplateId() method to pass it and provide a DataSource.

Make sure that the template provides the pageSize of the data source. If serverPaging is enabled, the ScrollView will request the data in advance so it becomes available before it is required, thus improving user experience. The Kendo UI ScrollView uses virtualization when it is bound to a data source and it only has three pages at all times—the current, the previous, and the next.

         DataSource(d =>
                  .Transport(t => t.Read(r => r.Url("")))
         HtmlAttributes(new { style = "height:600px; width:890px; max-width: 100%;" })
    <script id="employee-template" type="text/x-kendo-template">
        <div class="template">
                <span>#:TitleOfCourtesy# #: FirstName# #: LastName# </span>
            <h3>Title: #: Title #</h3>
            <div class="notes"><em>#:Notes#</em></div>
            <div class="country">
                #: Country #

See Also

In this article
Not finding the help you need? Improve this article