Back to Devexpress

Paging

aspnetmvc-120264-components-data-and-image-navigation-image-slider-paging.md

latest5.6 KB
Original Source

Paging

  • Feb 01, 2023
  • 2 minutes to read

The DevExpress MVC Image Slider (ImageSliderExtension) extension allows you to navigate images using the Image Area‘s navigation buttons and the Navigation Bar UI.

The following tables list the Image Slider’s paging settings:

Image Area

PropertyDescription
ImageSliderImageAreaSettings.EnableLoopNavigationSpecifies whether to implement infinite scrolling.
ImageSliderImageAreaSettings.NavigationDirectionSpecifies the image sliding direction (horizontal, vertical).
ImageSliderImageAreaSettings.NavigationButtonVisibilitySpecifies the navigation buttons’ visibility.
ImageSliderBehaviorSettings.EnablePagingByClickSpecifies whether an end-user can navigate through images by clicking the image’s left or right side.
ImageSliderBehaviorSettings.EnablePagingGesturesSpecifies whether an end-user can switch thumbnails with a swipe gesture.

Navigation Bar

PropertyDescription
ImageSliderNavigationBarSettings.PositionSpecifies the navigation bar’s position relative to the image area.
ImageSliderNavigationBarSettings.ModeSpecifies if the navigation bar displays its items as dots or thumbnails.
ImageSliderNavigationBarSettings.ThumbnailsModeNavigationButtonVisibilitySpecifies the navigation buttons visibility within the navigation bar. This property is in effect for Thumbnails mode only.
ImageSliderNavigationBarSettings.PagingModeSpecifies whether end-users scroll all the visible thumbnails in the navigation bar or one by one.
ImageSliderNavigationBarSettings.VisibleItemsCountSpecifies the number of thumbnails displayed within the navigation bar when the image area is hidden.

Virtual Paging Mode

The Image Slider loads all items when the extension is initialized, by default. The virtual paging mode enables end-users to load images on demand when navigating.

Set the ImageSliderBehaviorSettingsBase.EnableVirtualPaging property to true to enable this functionality.

cshtml
@Html.DevExpress().ImageSlider(settings => {
...
settings.SettingsBehavior.EnableVirtualPaging = true; 
settings.SettingsBehavior.VirtualPagingItemsPerRequest = 30; 
...
}).GetHtml()

The following table lists the API members related to the Image Slider’s virtual paging mode:

PropertyDescription
ImageSliderBehaviorSettingsBase.VirtualPagingItemsPerRequestSpecifies the minimum number of items the Image Slider loads when an end-user clicks the navigation button.
ASPxClientImageSlider.ItemLoadedOnCallbackFires for each Image Slider’s item that is loaded on callback (when the virtual paging mode is enabled).

Online Demo

To see this feature in action, please refer to the following online demo: ImageSlider - Virtual Paging.

You can navigate through the Image Slider items using client-side API listed in the following table:

API MemberDescription
ASPxClientImageSlider.GetActiveItem/ASPxClientImageSlider.SetActiveItemGets and sets the active item.
ASPxClientImageSlider.GetActiveItemIndex/ASPxClientImageSlider.SetActiveItemIndexGets and sets the active item index.
ASPxClientImageSlider.GetItem/ASPxClientImageSlider.GetItemByNameGet an item with the specified index/name.
ASPxClientImageSlider.GetItemCountGets the number of items.
ASPxClientImageSlider.GetLoadedItemsGets the loaded items.
ASPxClientImageSlider.ActiveItemChangedOccurs after the active image displayed within the image area changes.
ASPxClientImageSlider.ItemClickFires after an end-user clicks an item within the image area.