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

ListBox Item moved when copy expected

3 Answers 54 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
farzad
Top achievements
Rank 1
farzad asked on 28 Dec 2012, 08:18 PM
Hi,

I'm using RadControls for ASP.NET AJAX Q3 2012.
I have two list boxes which I want to transfer item between them bidirectional. everything works fine except when I use AllowTransferOnDoubleClick="True". In this case although I set TransferMode="Copy", the items moved when they exist in other list box.

<telerik:RadListBox runat="server" DataKeyField="ClassID" ID="RadListBox2" DataSourceID="SqlDataSource1" DataTextField="ClassName"
 TransferToID="RadListBox1" Style="top: 1px; right: 0px;
width: 191px;"  AllowTransferOnDoubleClick="True" TransferMode="Copy"
 DataValueField="ClassID" OnDataBound="RadListBox2_DataBound">
<ButtonSettings TransferButtons="All"></ButtonSettings>
</
telerik:RadListBox>
<
telerik:RadListBox ID="RadListBox1" runat="server" TransferMode="Copy" AllowTransfer="True" AppendDataBoundItems="True" DataKeyField="ClassID"
 DataSourceID="SqlDataSource2"
  DataTextField="ClassName" TransferToID="RadListBox2" Culture="fa-IR" Style="top: 0px;right: 9px; width: 191px;"
 DataValueField="ClassID"
AllowTransferOnDoubleClick="True" EnableMarkMatches="True"><ButtonSettings TransferButtons="All"></ButtonSettings>
</
telerik:RadListBox>

Where is the problem?!

Thanks for your concern

3 Answers, 1 is accepted

Sort by
0
Accepted
Kate
Telerik team
answered on 02 Jan 2013, 04:19 PM
Hello,

I tested the scenario that you describe with the following code but the items transfer as expected:

<telerik:RadListBox runat="server" ID="RadListBox1" Height="200px" Width="200px"
       AllowTransfer="true" AllowTransferOnDoubleClick="true" TransferMode="Copy" TransferToID="RadListBox2">
       <Items>
           <telerik:RadListBoxItem Text="Argentina"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Australia"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Brazil"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Canada"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Chile"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="China"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Egypt"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="England"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="France"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Germany"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="India"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Indonesia"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Kenya"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="Mexico"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="New Zealand"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="South Africa"></telerik:RadListBoxItem>
           <telerik:RadListBoxItem Text="USA"></telerik:RadListBoxItem>
       </Items>
   </telerik:RadListBox>
   <telerik:RadListBox runat="server" TransferMode="Copy" AllowTransferOnDoubleClick="true"
       AllowTransfer="true" ID="RadListBox2" Height="200px" Width="200px">
   </telerik:RadListBox>

Can you give it a try and let me know how it goes from your side?

Greetings,
Kate
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
farzad
Top achievements
Rank 1
answered on 02 Jan 2013, 06:41 PM
Hi, Thanks for your answer.

your code works fine on my side too. I found the problem with my code, and I think it is some kind of bug. if you set TransferToID="RadListBox" on both list box it will cause this error. but by removing this attribute from one side it will be fixed.

I think it should not be like this and user should assign the destination listbox id on both item.

Anyway thanks for your help.
0
Kate
Telerik team
answered on 07 Jan 2013, 04:11 PM
Hi,

You are correct that the transfer functionality should be available for both listboxes. It is actually available, but you will need to use the buttons on the left side of the left listbox when transferring items from left to right. I hope this brings more light on the scenario.

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