0
   <ListBox x:Name="My_ListBox"
        AlternationCount="2"
  <ListBox.ItemTemplate>
    <DataTemplate>
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="160" />
          <ColumnDefinition Width="110"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition MinHeight="28" />
        </Grid.RowDefinitions>

        <TextBlock x:Name="lblname"
         Grid.Row="0"
         Grid.Column="0"
         FontSize="14"
         Text="{Binding Label_Name}"
         MouseMove="Summary_MouseMove">
          <ToolTipService.ToolTip >
            <ToolTip>
              <TextBlock Visibility="Collapsed" x:Name="ToolTip">
                <Run Text="{Binding Label_Name}"/>
              </TextBlock>
            </ToolTip>
          </ToolTipService.ToolTip>
        </TextBlock>
        <TextBlock x:Name="lbllastname"
                   Grid.Row="0"
                   Grid.Column="1"
                   Margin="5,0"
                   FontSize="14"
                   Foreground="Black"
                   Text="{Binding Label_Value}"
                   TextWrapping="Wrap" />
      </Grid>
    </DataTemplate>
  </ListBox.ItemTemplate>
  <ListBox.ItemContainerStyle>
    <Style TargetType="ListBoxItem">
      <Setter Property="IsEnabled" Value="False" />
      <Style.Triggers>
        <Trigger Property="ItemsControl.AlternationIndex" Value="0">
          <Setter Property="Control.Background" Value="White" />
        </Trigger>
        <Trigger Property="ItemsControl.AlternationIndex" Value="1">
          <Setter Property="Control.Background" Value="White" />
        </Trigger>
      </Style.Triggers>
    </Style>
  </ListBox.ItemContainerStyle>
</ListBox>

In the above ListBox, I am displaying the ListBoxItem values in TextBlocks, The MouseMove event is not getting fired, Because of which the Tool tip does not show on Mouse over at the TextBlock 'lblname'. Can we have any alternative to show tooltip for the TextBlock ? Any help will be appreciated, Thanks !

  • Your tooltip and list box are collapsed... They would not be shown – Sasha Jun 22 '15 at 14:10
  • Even though, I set the visibility to visible, or remove it, It still doesn't make any effect. The MouseMove event doesnt gets fired – JohnyBravo 1422116 Jun 22 '15 at 14:15
  • http://stackoverflow.com/questions/192584/how-can-i-set-different-tooltip-text-for-each-item-in-a-listbox have a look. – Sasha Jun 22 '15 at 14:34

0 Answers0