radrotator index issue with newest release

2 posts, 0 answers
  1. Felipe
    Felipe avatar
    33 posts
    Member since:
    Dec 2010

    Posted 08 Apr 2011 Link to this post


    I think I may have found a problem (although it might not be an "exposed" problem) with the RadRotator in the most current release...

    I am setting attribute values of the rotator item from the database on ItemDataBound...

    then when the item is shown on the client, I update various GUI elements to what they should be based on the attributes.

    getting the item attributes of the radrotator was a bit difficult, and someone at telerik helped me by providing me with the GetAttributeValue function (shown in the javascript code below).

    Perhaps some of this has changed???

    The page was working fine, and then when I updated to the new release it started behaving a bit differently...

    if i move onto the nth item from the (n-1)th item, the GUI updates to the correct values for the (n-1)th item...

    on the other hand, if i move onto the nth item from the (n+1)th item, the GUI updates to the correct values for the (n+1)th item...

    any ideas?

    void _rotator_ItemDataBound(object sender, RadRotatorEventArgs e)
        DataRowView itemView = e.Item.DataItem as DataRowView;
        if (itemView != null)
            e.Item.Attributes["imageUrl"] = ImagesFolderUrl + itemView.Row["DocumentID"].ToString().PadLeft(8, '0') + "/" + itemView.Row["PageNumber"].ToString().PadLeft(4, '0');
            e.Item.Attributes["Author"] = isnullorempty(itemView.Row["Author"].ToString(), " ");
            e.Item.Attributes["AuthorTitle"] = isnullorempty(itemView.Row["AuthorTitle"].ToString(), " ");
            e.Item.Attributes["CompanyName"] = isnullorempty(itemView.Row["CompanyName"].ToString(), " ");
            e.Item.Attributes["PageNumber"] = itemView.Row["PageNumber"].ToString();
            e.Item.Attributes["TitleDescription"] = isnullorempty(itemView.Row["TitleDescription"].ToString(), " ");
            e.Item.Attributes["ConferenceName"] = isnullorempty(itemView.Row["Conference"].ToString(), " ");
            e.Item.Attributes["PresentationDate"] = ((DateTime)itemView.Row["DateOfPresentation"]).ToString("MMMM dd, yyyy");
            e.Item.Attributes["SlideID"] = itemView.Row["SlideID"].ToString();
            e.Item.Attributes["DocumentID"] = itemView.Row["DocumentID"].ToString();
            e.Item.Attributes["PageLayout"] = itemView.Row["PageLayout"].ToString();
            if (itemView.Row.Table.Columns.Contains("resultID"))
                e.Item.Attributes["resultID"] = itemView.Row["resultID"].ToString();

    function SetRotatorToSlideID(slideID) {
        var items = rotator.get_items();
        for (i in items) {
            if (slideID == GetAttributeValue(items[i], "SlideID")) {
                rotator.set_currentItemIndex(items[i].get_index(), true);
    function GetAttributeValue(anObject, strProperty) {
        if (anObject) {
            var attributes = $telerik.$('[' + strProperty + ']:first', anObject.get_element()).attr(strProperty);
            if (attributes) {
                return attributes;
    function RotatorClientItemShowing(sender, args) {
        stateHandled = true;
    function RotatorClientItemShown(sender, args) {
        stateHandled = false;
    function RotatorClientItemClicked(sender, args) {
        sender.set_currentItemIndex(args.get_item().get_index(), true);
    function UpdateGUI(item) {
        var companyName = GetAttributeValue(item, "CompanyName");
        var title = GetAttributeValue(item, "TitleDescription");
        var pageNum = GetAttributeValue(item, "PageNumber");
        var author = GetAttributeValue(item, "Author");
        var authorTitle = GetAttributeValue(item, "AuthorTitle");
        var conference = GetAttributeValue(item, "ConferenceName");
        var presDate = GetAttributeValue(item, "PresentationDate");
        var layout = GetAttributeValue(item, "PageLayout");
        document.getElementById("lblSelectedRotatorItem").innerText = companyName + " - " + title + " - " + author + " - Page " + pageNum;
        document.getElementById("LargeImage").src = GetAttributeValue(item, "imageUrl") + ".png";
        document.getElementById("LargeImage").width = ImageWidth(layout);
        document.getElementById("lblCompanyName").innerText = companyName;
        document.getElementById("lblTitle").innerText = title;
        document.getElementById("lblConferenceName").innerText = conference;
        document.getElementById("lblAuthor").innerText = author;
        document.getElementById("lblAuthorTitle").innerText = authorTitle;
        document.getElementById("lblDate").innerText = presDate;
        setHash(GetAttributeValue(item, "DocumentID"), GetAttributeValue(item, "SlideID"));


    it seems that the RotatorClientItemClicked event is also a bit faulty...

    when clicking an item, the rotator moves to the correct item, however it does NOT do so with animation...

    in addition, the GUI does not change at all when this happens...

  2. Niko
    Niko avatar
    404 posts

    Posted 11 Apr 2011 Link to this post

    Hi Leland,

    Please, find attached a sample page with a simplified implementation of the databound method(only one attribute is being set) and its extraction from the rotator item attribute data (note the content under the rotator saying "The id is #"). Using this setup I wasn't able to reproduce the issue that you are reporting on any browser. Still I can assume that the issue may be dependent other pieces of code, which I am missing, like the rotator definition, the definition of the labels or the whole page setup.
    I advice you to open a support ticket and attach there a sample project that reproduces the behavior that you are describing so that we can investigate it further.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top