wpf - Add struct to Combobox and display struct member as selected item -
wpf - Add struct to Combobox and display struct member as selected item -
i got simple struct
private struct _config { public string name; public int id; }
i want add together combobox show name displayed name in combobox. know how this?
i highly suggest reading links hb posted, here's code you're looking work towards:
change combobox items have get/set accessor methods:
private struct config { public string name { get; set; } public int id { get; set; } }
then combobox xaml should this
<combobox x:name="mycombobox" displaymemberpath="name" />
wpf combobox struct
Comments
Post a Comment