我有以下代码来选择 CheckListBox 中的下一个列表项或第一个列表项:
var calculateRate = cancellation.CancellationCalculateRates;
foreach (ListItem item in chkListRate.Items)
{
chkListRate.DataBind(); >>> Error Collection was modified; enumeration operation may not execute.
var cancel = ConverterHelper.To<int>(item.Value);
item.Selected = calculateRate.Any(i => i.CancellationId.Equals(cancel));
}
如何在 CheckListbox 上选择值后进行 DataBind?