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

AutoPostBackOnTransfer set to 'false' cuase RadListBox not able to keep correct items

2 Answers 127 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Yang
Top achievements
Rank 1
Yang asked on 13 Dec 2017, 05:40 AM

We have a project using 2 RadListBoxes to transfer items each other as below. when we double-click an item in one list, the item will be transferred to another list. That works very well. But in server side asp.net code, the number of items in each box is not correct. I tried to create an event handler for OnClientDoubleClicking and OnClientDoubleClicked to track and commit the changes. But it is still the same error.  Can someone help on this? Thanks.

 

<p><telerik:RadListBox runat="server" ID="rlbUnselectedStatus" AutoPostBackOnTransfer="false"<br>                            AllowTransfer="true" AllowTransferOnDoubleClick="true" TransferToID="rlbSelectedStatus"<br>                            DataTextField="StatusName" DataValueField="StatusId" CausesValidation="false"<br>                            SelectionMode="Multiple" Height="120px" Width="240px" TabIndex="1"  /></p><p><br>                        <telerik:RadListBox runat="server" ID="rlbSelectedStatus" AutoPostBackOnTransfer="false"<br>                             AllowTransfer="true" AllowTransferOnDoubleClick="true" TransferToID="rlbUnselectedStatus"<br>                            DataTextField="StatusName" DataValueField="StatusId"  CausesValidation="false" <br>                            SelectionMode="Multiple" Height="120px" Width="210px" TabIndex="1" /></p>

2 Answers, 1 is accepted

Sort by
0
Yang
Top achievements
Rank 1
answered on 13 Dec 2017, 06:08 AM

Let me provide more info. We also have a button (we call it 'search button' below)  to trigger the postback. in the event handler of that button. These 2 lists are to be used as one of the conditions for DB query.

When the page is initially loaded, e.g. list rlbUnselectedStataus has 8 different items. And rlbSlectedStatus is empty. We double-click 2 items in unselected list and these 2 items will be transferred to selectedlist. Then we click the search button to get some result. Until this step. everything is ok. But when we click one item in the selected list, now the total number of items in selected list should be 1. When I click the search button again, the items in unselected list is now 3 items (2 duplicate items for the current-still-in-selected-list  and one for the just-transferred). So the query result is still same with the previous one.

0
Peter Milchev
Telerik team
answered on 18 Dec 2017, 10:16 AM
Hello Yang,

We tried to replicate the scenario based on the provided code snippet and description but we were unable to replicate the issue as demonstrated in this screencast.

Attached is the sample project we used to record the screencast.

Regards,
Peter Milchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ListBox
Asked by
Yang
Top achievements
Rank 1
Answers by
Yang
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or