Search code examples
c#wpfcombobox

How can I read a ComboBox index


I asked this question a long time ago when I first started learning C# and I have come back to try and make sense of it to help the community.

The essence of the question was to read a comboxbox index when a user makes a change so the backend code could use the index selected. (there is many questions on stack answering this so I have flagged it as a duplicate)


Solution

  • This has been answered many times already, the combobox has a property called SelectedIndex for retrieving its index.

    Post that answers this: Get the current index of a ComboBox?