Im trying to figure out how I could display a different string in the ComboBox selection than what is displayed in the dropdown of the ComboBox.
<ComboBox SelectedItem="{Binding LocalFolderSelection, Mode=OneWayToSource}"
ItemsSource="{Binding LocalFolders}"
SelectedIndex="0"/>
Thats my combobox. LocalFolders
contains a list of string which are basically filepaths. Due to limited UI space, I cant make the ComboBox very wide so it could display the whole string. The dropdown scales automatically to fit the whole paths which is fine, but I need to reduce the displayed selection to just the filename.
Any ideas how I could achieve this? I was hoping there would be some property which I could use to define the display text, and maybe bind it to the SelectedItem with a converter that clips off the path, but so far I havent found anything like that.