Hi,
Am using two rad list box to transfer items each other mean while database call also
List boxes using :
OnTransferring event am updating certain data and the updation is working fine in ontransferring event.
But in the following scenarios transfer not working in both List Boxes,
1) if (e.SourceListBox.ID == "radListUnAssigned") {
When transferring, the item selected to transfer is not removing from the SouceListBox (ie, radListUnAssigned) but the
item is inserted in the Destination ListBox (ie,radListAssigned ).
2) else if (e.SourceListBox.ID == "radListAssigned") {
Here is my code snippet:
Thanks,
Am using two rad list box to transfer items each other mean while database call also
List boxes using :
<tr> <td align="left"> <telerik:RadListBox runat="server" ID="radListAssigned" Height="400px" Width="300px" TransferToID="radListUnAssigned" AllowTransfer="true" AutoPostBackOnTransfer="true" TransferMode="Move" DataTextField="abc" DataValueField="ID" SelectionMode="Multiple" OnTransferring="radListAssigned_Transferring"> <Localization AllToLeft="" AllToRight="" /> <ButtonSettings ShowTransferAll="False" TransferButtons="Common" /> </telerik:RadListBox> </td> <td align="left"> <telerik:RadListBox runat="server" ID="radListUnAssigned" Height="400px" Width="300px" TransferMode="Move" DataTextField="abc" DataValueField="ID" SelectionMode="Multiple"> <Localization AllToLeft="" AllToRight="" /> <ButtonSettings TransferButtons="All" /> </telerik:RadListBox> </td> </tr>
OnTransferring event am updating certain data and the updation is working fine in ontransferring event.
But in the following scenarios transfer not working in both List Boxes,
1) if (e.SourceListBox.ID == "radListUnAssigned") {
When transferring, the item selected to transfer is not removing from the SouceListBox (ie, radListUnAssigned) but the
item is inserted in the Destination ListBox (ie,radListAssigned ).
2) else if (e.SourceListBox.ID == "radListAssigned") {
The item selected not inserting to Destinationlistbox (ie, radListUnAssigned) but in
this case the item is removed from Source list box (ie, radListAssigned)
Here is my code snippet:
Please help me,protected void radListAssigned_Transferring(object sender, RadListBoxTransferringEventArgs e) { if (e.SourceListBox.ID == "radListUnAssigned") { int AssignedZipCity = 0; int NotAssignZipCity = 0; foreach (RadListBoxItem item in e.Items) { int isAssigned = -1; isAssigned = < Data updation call > if (isAssigned == 1) { AssignedZipCity += 1; } else if (isAssigned == 0) { e.Cancel = true; NotAssignZipCity += 1; } } }else if (e.SourceListBox.ID == "radListAssigned") { int UnAssignedZipCity = 0; int NotUnAssignZipCity = 0; foreach (RadListBoxItem item in e.Items) { int isUnAssigned = -1; isUnAssigned = < Data Updation call > if (isUnAssigned == 1) { UnAssignedZipCity += 1; } else if (isUnAssigned == 0) { e.Cancel = true; NotUnAssignZipCity += 1; } } }
Thanks,