简体   繁体   中英

c# wpf reclick combobox item

i have the following problem. I made a combobox in c# wpf. When i select an item, some data is loaded in a textbox. I have 3 buttons, change,delete and add.

The problem is, when i for example change something in the textbox(didn't save it yet) but i want to go back to the original value in the textbox. You can use ctr-z to go back. Is it also possible to reclick the selected item in the combobox to reload the data again? Now this is not possible, because the data is only loaded when the selectedItem in the combobox has changed, but that is not the case now. How can i add a reclick option in the combobox?

thanks a lot

If you post some code to let people have the big picture.

As a short answer: you may use SelectedItem property in the combobox to selected the item programmatically, basing on the value in your text box.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM