Hello, Michael,
I would like to follow up on this issue as our development team has investigated this case.
In the described setup, the CurrencyManager raises the PositionChanged event when the last item in the list is deleted. This updates the current item, which in turn triggers the drop-down list’s SelectedValueChanged event. As a result, the event handler executes the client’s logic to remove the selected value, causing a second removal attempt. This leads to the error, since the initial removal operation has not yet completed.
For all other items removed within the SelectedValueChanged handler, the issue does not occur because the CurrencyManager does not raise the PositionChanged event. We do not have control over how these events are triggered, and the existing logic appears to be correct.
Hence, we consider this issue as client specific setup and will set item status to Decline. The suggested workaround is valid and can be used in such a scenario.
If you have any other questions or concerns, please let me know.
Regards,
Nadya | Tech Support Engineer
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hello Michael,
To workaround this you can use the SelectedIndexChanging event:
private void radDropDownList1_SelectedIndexChanging(object sender, Telerik.WinControls.UI.Data.PositionChangingCancelEventArgs e)
{
try
{
e.Cancel = true;
ListItem selectedItem = (ListItem)radDropDownList1.Items[e.Position].DataBoundItem;
if (selectedItem == null || selectedItem.ID == 0)
return;
lvListItems.Add(selectedItem);
cbListItems.Remove(selectedItem);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
I hope this helps.
Regards,
Nadya
Progress Telerik