ListBox Item moved when copy expected

4 posts, 1 answers
  1. farzad
    farzad avatar
    13 posts
    Member since:
    Feb 2008

    Posted 28 Dec 2012 Link to this post

    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
  2. Answer
    Kate
    Admin
    Kate avatar
    1898 posts

    Posted 02 Jan 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. farzad
    farzad avatar
    13 posts
    Member since:
    Feb 2008

    Posted 02 Jan 2013 Link to this post

    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.
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 07 Jan 2013 Link to this post

    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.
Back to Top