Skip to content

[version 3.1] DisplayMemberPath not working on CheckComboBox  #752

@cuiliang

Description

@cuiliang

创建了一个演示项目,方便大佬快速确认一下:HcTest.zip

效果图:

image

主要代码:

namespace HcTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private IList<ObjectItem> _items;

        public MainWindow()
        {
            InitializeComponent();

            _items = new List<ObjectItem>()
            {
                new ObjectItem()
                {
                    Name = "张三",
                    Value = 99
                },
                new ObjectItem()
                {
                    Name = "李四",
                    Value = 98
                },
                new ObjectItem()
                {
                    Name = "王五",
                    Value = 97
                },
            };

            CheckComboBox.ItemsSource = _items;
            CheckComboBox.DisplayMemberPath = "Name";
        }
    }


    public class ObjectItem
    {
        public string Name { get; set; }
        public int Value { get; set; }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions