Cannot bind to the new display member in ComboBox

后端 未结 9 760
迷失自我
迷失自我 2021-01-01 21:14

I have a class which give me this error

public class Item 
{
    public string Name;
    public int Id

    public Item(string name, int id) 
    {
        N         


        
9条回答
  •  清歌不尽
    2021-01-01 21:42

    In my case I have solved this same problem by establishing the order in which I set the properties:

    With ComboBoxPartNumber
     .DisplayMember = "SuperSKU"
     .ValueMember = "TareRequired"
     .DataSource = _TblNP
     .Enabled = True
     .Refresh()
    With
    

    Here the _TblNP field is a global local field of type System.Data.DataTable.

提交回复
热议问题