I have 2 RadListBoxes where items can be transferred between them. One is Source and the other is Selected. Users will move items from the Source ListBox to the Selected ListBox to select items. On PostBack, the items in the Selected ListBox must be saved. Unfortunately, when I check the radListBoxSelected.Items on PostBack, nothing is there to save.
I started with just setting PersistClientChanges="true" but when that did not work, I added JavaScript handlers to the OnClientTransferring and OnClientTransferred events of the Selected ListBox that set trackChanges() and commitChanges() before and after each transfer. It still does not work. What do I need to do?
The are ListBoxes are defined as follows:
<rad:RadListBox ID="radListBoxSelected" runat="server" Skin="Vista" Height="120px" AllowTransfer="true" AllowTransferOnDoubleClick="true" AllowTransferDuplicates="false" ButtonSettings-ShowTransfer="true" ButtonSettings-ShowTransferAll="true" ButtonSettings-VerticalAlign="Middle" EnableDragAndDrop="true" Sort="Ascending" TransferToID="radListBoxSource" PersistClientChanges="true" />
<rad:RadListBox ID="radListBoxSource" runat="server" Skin="Vista" Height="120px" AllowTransferOnDoubleClick="true" AllowTransferDuplicates="false" EnableDragAndDrop="true" PersistClientChanges="true" />
OnClientTransferring JavaScript
function RadListBoxSelected_OnClientTransferring(sender, args) {
var listBox = $find('<control ID>');
listBox.trackChanges();
}
OnClientTransferred JavaScript
function RadListBoxSelected_OnClientTransferred(sender, args) {
var listBox = $find('<control ID>');
listBox.commitChanges();
}