set_imageurl not working after transferring item

3 posts, 1 answers
  1. Christian
    Christian avatar
    15 posts
    Member since:
    May 2009

    Posted 19 Apr 2013 Link to this post


    I can change the ImageUrl after transferring an item from left to right.
    BUT if I transfer it to left and then to the right side again. The ImageUrl cannot be change.

    Here's the demo:

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="Test.WebForm1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    <head runat="server">
        <script type="text/javascript">
            var containerPrefix = '';
            var trvElementsID = containerPrefix + 'trvElements';
            var trvQueriesID = containerPrefix + 'trvQueries';
            var trvOrdersID = containerPrefix + 'trvOrders';
            var trvRangesID = containerPrefix + 'trvRanges';
            var lsbOrderItemTargetID = containerPrefix + 'lsbOrderItemTarget';
            var hidQueriesChangedID = containerPrefix + 'hidQueriesChanged';
            var hidOrdersChangedID = containerPrefix + 'hidOrdersChanged';
            var hidRangesChangedID = containerPrefix + 'hidRangesChanged';
            function ToggleSort(sender, args) {
                //    debugger;
                var imgAsc = 'ascending.png';
                var imgDesc = 'descending.png';
                var listboxTarget = $find(lsbOrderItemTargetID);
                if (listboxTarget) {
                    var selectedItem = listboxTarget.get_selectedItem();
                    if (selectedItem) {
                        var oldImgUrl = selectedItem.get_imageUrl();
                        var arrUrl = oldImgUrl.split("/");
                        var oldValue = selectedItem.get_value();
                        var arrValue = oldValue.split(".");
                        if (arrValue[0] == 'asc') {
                            arrValue[0] = 'desc';
                            arrUrl[arrUrl.length - 1] = imgDesc;
                        } else {
                            arrValue[0] = 'asc';
                            arrUrl[arrUrl.length - 1] = imgAsc;
                        var newImgUrl = arrUrl.join("/");
                        var newValue = arrValue.join(".");
                    else {
                        alert('no item selected');
        <form id="form1" runat="server">
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" ScriptMode="Release" EnableScriptLocalization="true" EnableScriptGlobalization="true"
            CombineScripts="false" runat="server" EnablePartialRendering="true" />
            <telerik:RadListBox ID="lsbOrderItemSource" SelectionMode="Multiple" AllowTransfer="true" AllowReorder="false" TransferToID="lsbOrderItemTarget"
                PersistClientChanges="true" Skin="Outlook" runat="server" Height="500px" Width="30%" >
                        <telerik:RadListBoxItem Text="test1" ImageUrl="Images/ascending.png"/>
                        <telerik:RadListBoxItem Text="test2" ImageUrl="Images/ascending.png"/>
                        <telerik:RadListBoxItem Text="test3" ImageUrl="Images/ascending.png"/>
                        <telerik:RadListBoxItem Text="test4" ImageUrl="Images/ascending.png"/>
            <telerik:RadButton runat="server" ID="teleriktoggle" Text="ASC/DESC" OnClientClicked="ToggleSort" AutoPostBack="false"></telerik:RadButton>
            <telerik:RadListBox ID="lsbOrderItemTarget" SelectionMode="Multiple"
                AllowReorder="true" Skin="Outlook" runat="server" Height="500px" Width="30%" PersistClientChanges="true"/>

    Thanks in advance for your help.
  2. Christian
    Christian avatar
    15 posts
    Member since:
    May 2009

    Posted 24 Apr 2013 Link to this post

  3. Answer
    Nencho avatar
    1661 posts

    Posted 24 Apr 2013 Link to this post

    Hello Christian,

    This is a development issue, which I have logged. As a temporary workaround, I could suggest you to enable the AutoPostBackOnTransfer property of the Source RadListBox. If you do not want a postback to occur when transferring items, you could still use the aforementioned property, but in addition you could ajaxify the RadListBoxes. As a token of gratitude, for reporting for that problem, I have updated your Telerik Points.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top