RadRotator
RadRotator Control
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[RequiredScript(typeof(AnimationScripts))]
[RequiredScript(typeof(MaterialRipple))]
[RequiredScript(typeof(IETouchActionManager))]
[ClientScriptResource("Telerik.Web.UI.RadRotator", "Telerik.Web.UI.Common.Navigation.NavigationScripts.js")]
[ClientScriptResource("Telerik.Web.UI.RadRotator", "Telerik.Web.UI.Rotator.RadRotator.js")]
[TelerikToolboxCategory("Visualization")]
[ToolboxBitmap(typeof(RadRotator), "Toolbox.Icons.Rotator.png")]
[EmbeddedSkin("Rotator")]
[EmbeddedSkin("Rotator", "Default")]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadRotator))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadButton))]
public class RadRotator : RadDataBoundControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IFeatureGroup, IPostBackEventHandler, INamingContainer
Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlRadDataBoundControlRadRotator...
Implements:
Inherited Members
Constructors
public RadRotator()
Properties
Specifies whether the Rotator items created on the client-side should be cleared before data binding.
[ClientControlProperty]
public bool AppendClientDataBoundItems { get; set; }
public bool AppendDataBoundItems { get; set; }
Gets or sets a value indicating whether a postback to the server automatically occurs when the user interacts with the control.
public virtual bool AutoPostBack { get; set; }
The default value is false.
Setting this property to true will make Telerik RadRotator postback to the server on item click.
Gets or sets the virtual path where the rotator will look for ads/banners (images) to play. This property basically enables the Ad mode of the Rotator. The default value is string.Empty.
public string BannersPath { get; set; }
The default value is an empty string.
Gets or sets the HTML template that will be used when the Rotator is databound to ClientDataSource.
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual string ClientTemplate { get; set; }
[PersistenceMode(PersistenceMode.InnerProperty)]
public RotatorControlButtonsConfiguration ControlButtons { get; }
The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()
protected override string CssClassFormatString { get; }
Overrides:
Gets or sets a flag determining if drag-scrolling should be enabled.
[ClientControlProperty]
public bool EnableDragScrolling { get; set; }
The default value is false. This means the drag-scrolling is not enabled.
Gets or sets a value indicating whether to randomize the order of display for the rotator items.
[ClientControlProperty]
public bool EnableRandomOrder { get; set; }
The default value is false. This means the items will be displayed in the order they appear in the datasource.
Specifies the time in milliseconds each frame will display in automatic scrolling scenarios.
[ClientControlProperty]
public int FrameDuration { get; set; }
Default: 2000
Gets or sets the height of the Web server control. The default height is 200 pixels.
public override Unit Height { get; set; }
Overrides:
Specifies the index of the item, which will be shown first when the rotator loads. When set to 0 (default) - positions initial item to be visible in the rotator. When set to -1 - positions the initial item just outside of the rotator viewport. Any other positive value - the rotator starts with that particular item in the viewport.
[ClientControlProperty]
public int InitialItemIndex { get; set; }
Default: 0
Specifies the default rotator item height.
public Unit ItemHeight { get; set; }
Default: Unit.Empty
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
public RadRotatorItemCollection Items { get; }
[TemplateContainer(typeof(RadRotatorItem))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public ITemplate ItemTemplate { get; set; }
Specifies the default rotator item width.
public Unit ItemWidth { get; set; }
Default: Unit.Empty
Gets or sets the name of the JavaScript function that will be called when the Rotator is databound on the client-side.
[ClientControlEvent]
[ClientPropertyName("dataBound")]
public string OnClientDataBound { get; set; }
The name of the javascript function called after an item is clicked.
[ClientControlEvent]
[ClientPropertyName("itemClicked")]
public string OnClientItemClicked { get; set; }
The name of the javascript function called when an item is clicked.
[ClientControlEvent]
[ClientPropertyName("itemClicking")]
public string OnClientItemClicking { get; set; }
Gets or sets the name of the JavaScript function that will be called when an item is databound on the client-side.
[ClientControlEvent]
[ClientPropertyName("itemDataBound")]
public string OnClientItemDataBound { get; set; }
The name of the javascript function called when an item is about to be shown.
[ClientControlEvent]
[ClientPropertyName("itemShowing")]
public string OnClientItemShowing { get; set; }
The name of the javascript function called after an item has been shown.
[ClientControlEvent]
[ClientPropertyName("itemShown")]
public string OnClientItemShown { get; set; }
Gets or sets a value indicating the client-side event handler that is called when the RadRotator items were just populated when load on demand(from web service).
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemsRequested")]
public string OnClientItemsRequested { get; set; }
Gets or sets a value indicating the client-side event handler that is called when the operation for populating the RadRotator when load on demand has failed.
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemsRequestFailed")]
public string OnClientItemsRequestFailed { get; set; }
Gets or sets a value indicating the client-side event handler that is called when the RadRotator items are about to be populated when load on demand(from web service).The event is cancellable
[Bindable(false)]
[ClientControlEvent]
[ClientPropertyName("itemsRequesting")]
public string OnClientItemsRequesting { get; set; }
The name of the javascript function called when the rotator is loaded on the client. The function is called right before the automatic animation (if used) begins.
[ClientControlEvent]
[ClientPropertyName("load")]
public string OnClientLoad { get; set; }
The name of the javascript function called after the mouse leaves an item.
[ClientControlEvent]
[ClientPropertyName("mouseOut")]
public string OnClientMouseOut { get; set; }
The name of the javascript function called when the mouse hovers over an item.
[ClientControlEvent]
[ClientPropertyName("mouseOver")]
public string OnClientMouseOver { get; set; }
Gets or sets the name of the JavaScript function called when the client template for an item is evaluated.
[ClientControlEvent]
[ClientPropertyName("templateDataBound")]
public string OnClientTemplateDataBound { get; set; }
Gets or sets a value indicating whether to pause the rotator scrolling when the mouse is over a roatator item
[ClientControlProperty]
public bool PauseOnMouseOver { get; set; }
The default value is true. This means the animation will be paused when the user hovers over a rotator item.
Gets or sets a value indicating whether the index of current item is persisted between postbacks.
[Bindable(false)]
[ClientControlProperty]
public bool PersistCurrentItemOnPostBack { get; set; }
[Themeable(false)]
public string PostBackUrl { get; set; }
Specifies the type of rotator [how the rotator will render and what options the user will have for interacting with it on the client] RotatorType
[ClientControlProperty]
public RotatorType RotatorType { get; set; }
Default: RotatorType.Buttons
Specifies possible directions for scrolling rotator items. RotatorScrollDirection
[ClientControlProperty]
public RotatorScrollDirection ScrollDirection { get; set; }
Default: RotatorScrollDirection.Left | RotatorScrollDirection.Right
Specifies the speed in milliseconds for scrolling rotator items.
[ClientControlProperty]
public int ScrollDuration { get; set; }
Default: 500
[PersistenceMode(PersistenceMode.InnerProperty)]
public AnimationSettings SlideShowAnimation { get; }
protected override bool SupportsRenderingMode { get; }
Overrides:
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Gets the settings for the web service used to populate items
[PersistenceMode(PersistenceMode.InnerProperty)]
public WebServiceSettings WebServiceSettings { get; }
An WebServiceSettings that represents the web service used for populating items.
Use the WebServiceSettings property to configure the web service used to populate items on demand. You must specify both Path and Method to fully describe the service.
In order to use the integrated support, the web service should have the following signature:
<pre><code class="lang-csharp">[ScriptService]public class WebServiceName : WebService { [WebMethod] public RadRotatorItemData[] WebServiceMethodName(int itemIndex, int itemCount) { List<RadRotatorItemData> result = new List<RadRotatorItemData>(); RadRotatorItemData item; for (int i = 0; i < itemCount; i++) { item = new RadRotatorItemData(); item.Html = "test "+(itemIndex+i); result.Add(item); } return result.ToArray(); } }
Gets or sets the width of the Web server control. The default width is 200 pixels.
public override Unit Width { get; set; }
Overrides:
[ClientControlProperty]
public bool WrapFrames { get; set; }
Methods
Binds the RadRotator to the collection of images found in the provided BannersPath. If no path is provided the Rotator will use the data source provided.
public void BindToBanners(bool forceBind = false)
Forces the rotator to request the images from the specified location.
This method is called by the RadRotator on PreRender. Therefore you don't have to call it unless you want to explicitly force the rotator to request its items.
Binds the rotator to a IEnumerable data source
public void BindToEnumerableData(IEnumerable dataSource)
IEnumerable data source
Code moved into this method from OnPreRender to make sure it executed when the framework skips OnPreRender() for some reason
protected override void ControlPreRender()
Overrides:
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
protected virtual RadRotatorItem FindItemByHierarchicalIndex(string hierarchicalIndex)
Gets all the images (used as banners/ads) from the specified folder.
protected virtual List<BannerDataItem> GetBanners(string virtualPath, string allowedExtensions)
The virtual path to the folder where the images will be taken.
allowedExtensionsstringThe string of comma-separated allowed image extensions.
Returns:Collection of all the images in the specified folder.
Gets a string of comma-separated allowed image extensions when the rotator searches the BannersPath for image files.
protected virtual string GetImageExtensions()
The string of comma-separated allowed image extensions. The default allowed extensions are: ".jpg,.jpeg,.gif,.png,*.bmp,".
Executed when post data is loaded from the request
protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection)
Overrides:
protected override void PerformDataBinding(IEnumerable data)
Overrides:
protected void PrepareForDataBinding()
protected void RaiseRotatorItemEvent(RadRotatorItem item, object eventKey)
protected override void RenderContents(HtmlTextWriter writer)
Overrides:
protected override void TrackViewState()
Overrides:
Events
public event RadRotatorEventHandler ItemClick
public event RadRotatorEventHandler ItemCreated
public event RadRotatorEventHandler ItemDataBound