I got a simple struct
private struct _config
{
public string name;
public int id;
}
I want to add it to a combobox but show name as the displayed name in the combobox. Does anyone know how to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would highly suggest reading the links HB posted, however here’s the code you’re looking to work towards:
Change your ComboBox items to have get/set accessor methods:
Then your ComboBox XAML should look like this