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

Transfer template from one listbox to another

2 Answers 133 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Rémy
Top achievements
Rank 1
Rémy asked on 24 Jul 2012, 07:22 PM
Hi,

I have four listbox. Three of them contains items that could be transferred to the other. Users change the visible listbox with a radio button. Each listbox contains a different template item, so my listbox that receive items can't have a template item. I've try the client-side transfer mode but it's doesn't transfer the item completly; my item is display is plain text, without any html code. I've seen in the help documentation (http://www.telerik.com/help/aspnet-ajax/listbox-templates-overview.html) that I can't transfer template in client-side mode, only on server-side. I can't use transfer button between the listbox because we want the user to do one-click only to transfer one item, and not select and item and click on the button. I can't put a button element in each item because it will trigger an exception (ThrowIfMaxHttpCollectionKeysExceeded). Presently, I try to simulate a button with a div element, but I can't put an id in my item template because an id have to be unique in a HTML page, so I can't put an function assigned to this div...

Exemple of a listbox:
<telerik:RadListBox ID="lbxDepDisponibles"
        runat="server" Height="300px" Width="335px" Visible="false"
        TransferToID="lbxTraites" DataValueField="number" >
    <ItemTemplate>              
        <div class="listeDispo departementTraite">
            <div>
                <img class="adminButton" src="Images/Administre.gif" height="32" style="margin:0px" />
            </div>
            <div class="dispoInfo">
                <div class="cboContent" style="display:block;">
                    <span style="font-weight: bold;">
                        <%#DataBinder.Eval(Container, "Attributes['description']")%>
                        <span style="font-size: 10px;">
                            <br />Dep. # <%#DataBinder.Eval(Container, "Attributes['number']")%> - <%#DataBinder.Eval(Container, "Attributes['name']")%>
                        </span>
                    </span>
                </div>
            </div>
        </div>
    </ItemTemplate>
</telerik:RadListBox>


My question is: how can I transfer an item from one listbox to another, with the item template, without using the transfer button, with a div element (or any other html element that is not an input element) that play the button role in each item?

Thank you

  • Visual studio 2008 .NET 3.5 SP1
  • Windows 7
  • any browser
  • Telerik ASP.NET AJAX 2012.1.301.2
  • VB.NET

2 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 27 Jul 2012, 09:01 AM
Hi,

I've attached a sample page that demonstrates the desired functionality. 
 
Regards,
Bozhidar
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.
0
Rémy
Top achievements
Rank 1
answered on 31 Jul 2012, 06:19 PM
Ok it works. Thank you!
Tags
ListBox
Asked by
Rémy
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Rémy
Top achievements
Rank 1
Share this question
or