Sorted 为真时 SelectedValue 的问题(ComboBox)

5 c# sorting combobox winforms

设置ComboBox.Sorted为 时trueComboBox.SelectedValue返回与可见选择的值不同的值。

加载项目并显示:

using (ModelContext model = new ModelContext())
{
    cbWorker.ValueMember = "IdWorker";
    cbWorker.DisplayMember = "FullName";

    bindingWorker.DataSource = model.Workers.Select(x => new ItemWorker{
            IdWorker = x.Id,
            FullName = x.FullName
        })
        .ToList();

    cbWorker.DataSource = bindingWorker;
}

private void CbWorker_SelectedValueChanged(object sender, EventArgs e)
{
    object x = cbWorker.SelectedValue;
    if (x!= null) label.Text = x.ToString();
}
Run Code Online (Sandbox Code Playgroud)

如果ComboBox.Sorted = falseSelectedValue可以:

在此处输入图片说明

但如果ComboBox.Sorted = true,SelectedValue不行:

在此处输入图片说明

有可能修复它吗?类似的问题,例如,CheckedListBox