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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -