0

I have a combobox to which I am binding a List. For each item in a combobox based on ID, I fetch data from Database and display tool tip. ToolTip is able to get proper data for the first time.

When I change any other item in Combobox the tool tip still shows the old content? How can I get the updated value when the combobox selection is changed?

Below is my Xaml Code:

<ddd:ComboBoxEdit x:Name="pboPlayers"
 Focusable="False"
 NullText="Select Players"
 Background="White"
 VerticalAlignment="Top"
 Height="24"
 ItemsSource="{Binding Path=RowData.Row.PlayerList}"
 DisplayMember="PlayerName"
 ValueMember="PlayerPk"
 SelectedIndex="0"
 <dxmvvm:Interaction.Behaviors>
   <dxmvvm:EventToCommand EventName="SelectedIndexChanged" Command=" 
{Binding RowData.Row.OnPlayerChangedCommand}" 
 PassEventArgsToCommand="True"/>
    </dxmvvm:Interaction.Behaviors>
  <ddd:ComboBoxEdit.ToolTip>
     <ToolTip>
     <ToolTip.Style>
                <Style TargetType="{x:Type ToolTip}">
                   <Style.Triggers>
                        <DataTrigger Binding="{Binding 
 Path=RowData.Row.PlayerToolTipText}" Value="">
                            <Setter Property="Visibility" 
Value="Collapsed"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding 
Path=RowData.Row.PlayerToolTipText}" Value="{x:Null}">
                             <Setter Property="Visibility" 
 Value="Collapsed"/>
                        </DataTrigger>
                   </Style.Triggers>
                  </Style>
             </ToolTip.Style>
             <TextBlock ToolTip="{Binding Path=RowData.Row.PlayerToolTipText}" />
       </ToolTip>
  </ddd:ComboBoxEdit.ToolTip>

halfer
  • 19,824
  • 17
  • 99
  • 186
Avinash
  • 101
  • 1
  • 1
  • 6
  • I cant see any code? Anyway that aside. see if you can glean anything from this https://stackoverflow.com/questions/2212171/wpf-tooltip-binding – TheGeneral Mar 21 '20 at 05:10
  • 2
    Two-Way-Binding for the ToolTip property does not make any sense – Sir Rufo Mar 21 '20 at 06:18
  • Kindly show us some code. – G K Mar 21 '20 at 07:18
  • I have added Xaml code. When i change the Combo box item , I am passing the Selected index and fetching the data from the data base related to that index and updating "PlayerToolTipText" property in my model. But when i mouse over on the Combo box , it would still display tool tip that was loaded initially. Could you please suggest me how to correct this? – Avinash Mar 22 '20 at 04:14

0 Answers0