Item's Tooltip

2 posts, 0 answers
  1. syed
    syed avatar
    21 posts
    Member since:
    Sep 2010

    Posted 17 Jan 2011 Link to this post

    All,
    I want to display tooltip on each item of the combobox. i'm doing the following way to display it
    <telerik:RadComboBox Grid.Row="10" Grid.Column="1" x:Name="Mycombobox"   VerticalAlignment="Bottom" HorizontalAlignment="Left"
                                    Width="180" FontSize="10" Height="18" ItemsSource="{Binding ContinentRefDataList, Mode=TwoWay}" DisplayMemberPath="ContinentCode"
                                    SelectedValuePath="ContinentID" Text="{Binding ContinentCode, Mode=TwoWay}"
                                    SelectedValue="{Binding ContinentID, ValidatesOnExceptions=True, NotifyOnValidationError=True, Mode=TwoWay}"
                                                     ToolTipService.ToolTip="{Binding ContinentName}"
                                                     >
                                </telerik:RadComboBox>

    But this is not showing the tooltip of each items continent name. though it shows the continentcode correctly. Please guide me in this easy task. I want to display continent name of each dropdown item (not only of selected one).

    Thanks.
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 18 Jan 2011 Link to this post

    Hi Syed,

    You should add a TooltipService.ToolTip in the ItemTemplate of RadComboBox rather than the ComboBox itself. For example,
    <telerik:RadComboBox Width="200" VerticalAlignment="Center">
                <telerik:RadComboBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Content}" Foreground="Red">  
                                <ToolTipService.ToolTip>  
                                    <ToolTip Content="TEXT" />
                                </ToolTipService.ToolTip>
                            </TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </telerik:RadComboBox.ItemTemplate>
      
    ...
    </telerik:RadComboBox>

    I hope this helps.

    Best wishes,
    Dani
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
Back to Top