This is a migrated thread and some comments may be shown as answers.

RadListBox and transfering templated items

1 Answer 88 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 06 Oct 2010, 03:41 PM
I've read many posts here and elsewhere on this topic, that discuss the shenannigans people have to go through to get templates to properly render on the destination side based on whatever thing they are doing with their source RadListBox, but something I have not been able to discern, is whether or not there is any instance where a simple databound list box with no fancy components embedded in the templates can still be implemented without a postback (just client-side).

For example, given this very simple example below where I have the two RadListBoxes hooked up and I want them to show the same format in both boxes :

<telerik:RadListBox runat="server" ID="RadListBoxSource" Height="200px" Width="200px"
    AllowTransfer="True" TransferToID="RadListBoxDestination" DataSourceID="SqlDataSource1"
    DataValueField="USR_SEQ" DataTextField="USR_LOGINID"
    SelectionMode="Multiple">
     
    <ItemTemplate>
        <div class="ld1">
            <%# DataBinder.Eval(Container.DataItem, "USR_LOGINID")%></div>
        <div class="ld2">
            <%# DataBinder.Eval(Container.DataItem, "USR_NAME")%></div>
    </ItemTemplate>
    
</telerik:RadListBox>
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
    SelectCommand="SELECT [USR_LOGINID], [USR_SEQ], (USR_NAME_FIRST + ' ' + USR_NAME_LAST) USR_NAME FROM [USR] order by usr_loginid">
</asp:SqlDataSource>
 
<telerik:RadListBox runat="server" ID="RadListBoxDestination" Height="200px" Width="200px">
 
    <ItemTemplate>
        <div class="ld1">
            <%# DataBinder.Eval(Container.DataItem, "USR_LOGINID")%></div>
        <div class="ld2">
            <%# DataBinder.Eval(Container.DataItem, "USR_NAME")%></div>
    </ItemTemplate>
 
</telerik:RadListBox>

What am I missing to get this to work?  Does there absolutely have to be a postback to just get the second listbox to use the same template format as the first list box?  Does the fact that it is a databound list force my hand?  For what it is worth, I also downloaded a number of examples posted by Telerik developers and even with the post-back versions, could not get my simple example to work correctly, but I assume that is because I am missing some painfully obvious clue.



1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 11 Oct 2010, 04:26 PM
Hello Thomas,

When templates are used it is necessary to perform postback (no matter ajax or full). The reason is simple, should we allow one to transfer templated items on the client, there is no way to apply the template once the page is posted back. The dataitems are going to be lost.  In future releases of RadListBox, we might try to workaround this limitation, however, at the moment you will need to (ajax)postback when templates items should be transferred.

Greetings,
Genady Sergeev
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
Tags
ListBox
Asked by
Thomas
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or