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

item disappears when the transfer mode=copy

5 Answers 111 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Anjali
Top achievements
Rank 1
Anjali asked on 01 Jul 2011, 03:54 PM
Hi,

  I have two listboxes, On my left side of list boxes, I have some items, when i transfer the items to the right side listbox, I add two checkboxes before those items. Everything works fine when the transferMode = move, but when I changed the transferMode=Copy then when I move the item from the left listbox to the right listbox, the checkboxes appear in the right list box, but items don't appear.
I am not sure what am I doing wrong. below is my code
<td style="width:"10%" >
           ag: <br />
               <telerik:RadListBox runat="server" ID="RadListBox_Unselectedag" AutoPostBack="false"
               Width="120px" Height="200px" 
               TransferToID="RadListBox_selectedag" AllowTransfer="true" TransferMode="Copy"
               AutoPostBackOnTransfer="true" SelectionMode="Multiple" AllowDelete="false" AllowReorder="false" ontransferred="RadListBox_Unselectedag_Transferred" >
           </telerik:RadListBox>
       </td>
       <td style="width:"2%">aselected <br />
           <telerik:RadListBox runat="server" ID="RadListBox_selectedag" AllowDelete="true" AllowReorder="false"
               AutoPostBack="false" SelectionMode="Multiple" Width="140px" Height="200px"    >
               <ItemTemplate>
                 
                  <asp:CheckBox ID="chkAD" runat="server" />
                   <asp:CheckBox ID="chkAS" runat="server" />
                   <asp:Label ID="lblagSelected" runat="server" Text='<%# DataBinder.Eval(Container,"Text") %>'></asp:Label>
               </ItemTemplate>
                
           </telerik:RadListBox>
         
       </td>
       <td>

My code behind looks like this

protected void RadListBox_Unselectedag_Transferred(object sender, RadListBoxTransferredEventArgs e)
        {
            foreach (RadListBoxItem item in e.Items)
            {
                item.DataBind();
            }
        }

5 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 06 Jul 2011, 03:15 PM
Hello Anjali,

The issue occurs, because you are using ItemTemplate into RadListBox control. Please review the attached project. In your scenario it is possible to use the property of the RadListBox, CheckBoxes="True".

Greetings,
Peter Filipov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Anjali
Top achievements
Rank 1
answered on 06 Jul 2011, 03:30 PM
Hi,

  The attached project does not have any checkboxes, I need two columns of checkboxes in my sourcelistbox. can you give me example that has two columns of checkboxes.

Thanks,

Anjali
0
Anjali
Top achievements
Rank 1
answered on 06 Jul 2011, 05:43 PM
I tried the code line by line, didn't work. I need two columns of checkboxes.
0
Accepted
Peter Filipov
Telerik team
answered on 12 Jul 2011, 04:16 PM
Hello Anjali,

I was able to reproduce your issue. Please review the attached project. Please bind the RadListBox on the right side when an item is transferred.

Best wishes,
Peter Filipov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Anjali
Top achievements
Rank 1
answered on 12 Jul 2011, 04:46 PM
Thanks Peter!!
Tags
ListBox
Asked by
Anjali
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Anjali
Top achievements
Rank 1
Share this question
or