Skip to main content

ASPxClientImageSlider.SetActiveItemIndex(index, preventAnimation) Method

Makes the specified item active within the image slider control on the client side.

Declaration

SetActiveItemIndex(
    index: number,
    preventAnimation: boolean
): void

Parameters

Name Type Description
index number

The index of the item to select.

preventAnimation boolean

true to prevent the animation effect; false to change images using animation.

Remarks

The image slider control provides the capability to make items active on the client side using the SetActiveItemIndex method.

Note that the control always has the active item and only one item can be active within the control at the same time. So, the SetActiveItemIndex method is in effect if it has passed a correct item index which lies in the range of 0 to the ASPxClientImageSlider.GetItemCount value decremented by one.

Example

This example demonstrates how to implement custom SlideShow functionality by using the ASPxImageSlider's client-side API.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxHiddenField;

namespace E4913 {
    public partial class Default : System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {

        }

        protected void hfCustomIntervals_Init(object sender, EventArgs e) {
            ASPxHiddenField hiddenField = sender as ASPxHiddenField;

            hiddenField["Cherries"] = 2000;
            hiddenField["Raspberry"] = 5000;
            hiddenField["Strawberry"] = 1000;
            hiddenField["Tomatoes"] = 4000;
        }
    }
}
See Also