I am writing a C # application using winforms. I have a list. I get data from xml file, username and their identifiers. I want the names to appear in the list, and when I select one of them, I want to get his / her identifier using the selectedValue property. However, I cannot do this. I tried keyValuePair, which shows "[username, id]" in a list that is not good (see code below). How can I simulate html select in C # in short? I want the names to appear in the list, but want to get the identifier in the backend. Thanks...
LB_UserList.Items.Add(new KeyValuePair<string, string>(full_name, node["user_id"].InnerText));
source share