
Konstantin Vyaznikov
Top achievements
Rank 1
Konstantin Vyaznikov
asked on 29 Oct 2009, 06:41 PM
Is there a way to transfer all items from source listbox to destination listbox on a client side using javascript?
Thanks!
Thanks!
4 Answers, 1 is accepted
0

Schlurk
Top achievements
Rank 2
answered on 29 Oct 2009, 09:46 PM
I believe this documentation article, with some modification, should allow you to transfer all of the items in your RadListBox through client-side.
0
Hello Konstantin Vyaznikov,
Transferring items on the client using JavaScript is supported by default. The only thing you need to do is to set the TransferTo property of the source and make sure that the AllowTransfer property is set to true. You can find example demonstrating the approach here.
Kind regards,
Genady Sergeev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Transferring items on the client using JavaScript is supported by default. The only thing you need to do is to set the TransferTo property of the source and make sure that the AllowTransfer property is set to true. You can find example demonstrating the approach here.
Kind regards,
Genady Sergeev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0

Warren
Top achievements
Rank 2
answered on 28 Jun 2014, 11:06 PM
I know this forum question is quite old but I wanted to share this javascript function I created to transfer all items from the source listbox to the destination listbox or all items from the destination listbox to the source listbox. I wrote this to handle the user checking a checkbox to indicate an "All" items. I then added a client onclick to the ASP.NET checkbox to call this function. Make sure the source list box has these set AllowTransfer="true" and the TransferToID="destinationListBox".
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function TransferAllListBoxItems(sourceListBoxName,destListBoxName,checked)
{
var listSrc = $find(sourceListBoxName);
var listDst = $find(destListBoxName);
if(checked)
{
while (listSrc.get_items().get_count() > 0) {
listSrc.transferToDestination(listSrc.getItem(0));
}
}
else
{
while (listDst.get_items().get_count() > 0) {
listSrc.transferFromDestination(listDst.getItem(0));
}
}
}
</
script
>
</
telerik:RadCodeBlock
>
0
Hello Warren,
Thank you for sharing your solution with the community.
Regards,
Nencho
Telerik
Thank you for sharing your solution with the community.
Regards,
Nencho
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.