Currently I have a ComboBox defined as:
<ComboBox Name="comboItems" ItemsSource="{Binding Path=EnumDataItems}"
DisplayMemberPath="Description"
ToolTip="{Binding Path=ToolTip}" // never displays the value
SelectedValuePath="Value" SelectedValue="{Binding Path=Value}" />
Everything works except the ToolTip. The property that it should bind to; ToolTip
does contain a value. I'm sure of this because when I do the following, I see a result confirming that ToolTip contains a value:
<ComboBox Name="comboItems" ItemsSource="{Binding Path=EnumDataItems}"
DisplayMemberPath="ToolTip" // I replaced 'Description' with 'ToolTip'
ToolTip="{Binding Path=ToolTip}"
SelectedValuePath="Value" SelectedValue="{Binding Path=Value}"/>
Having replaced Description
with ToolTip
I can see that the value of ToolTip is appearing on the screen. However
ToolTip="{Binding Path=ToolTip}"
still doesn't work. If I attempt to display ToolTip as follows:
ToolTip="ToolTip"
it just displays the word 'ToolTip'.
How can I get ToolTip
to display a value?
ToolTip="{Binding Path=ToolTip}"
binds toToolTip
property of current combo boxDataContext
(object that containsEnumDataItems
property). Assuming you want to setToolTip
ofComboBox
to currently selected item'sToolTip
property value, this should fix the problem:If a
ToolTip
for everyComboBoxItem
is what you want you can do this: