How to get ToolTip binding to work with a ComboBox? How to get ToolTip binding to work with a ComboBox? wpf wpf

How to get ToolTip binding to work with a ComboBox?


If a ToolTip for every ComboBoxItem is what you want you can do this:

<ComboBox.ItemContainerStyle>    <Style>        <Setter Property="Control.ToolTip" Value="{Binding ToolTip}" />    </Style></ComboBox.ItemContainerStyle>


ToolTip="{Binding Path=ToolTip}" binds to ToolTip property of current combo box DataContext (object that contains EnumDataItems property).Assuming you want to set ToolTip of ComboBox to currently selected item's ToolTip property value, this should fix the problem:

ToolTip="{Binding Path=SelectedItem.ToolTip, RelativeSource={RelativeSource Self}}"