We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Show ToolTip in Suggestion Box

Thread ID:

Created:

Updated:

Platform:

Replies:

149658 Dec 4,2019 02:48 PM UTC Dec 6,2019 06:46 AM UTC WPF 3
loading
Tags: SfTextBoxExt
Victor Dienstbier
Asked On December 4, 2019 02:48 PM UTC

Hi!


Is there a way to show a ToolTip for each element in the suggestion box?

I tried this but I seem to have the wrong Type:

<syncfusion:SfTextBoxExt AutoCompleteMode="Suggest"
                                                             SuggestionMode="StartsWith"
                                                             ShowSuggestionsOnFocus="True"
                                                             VerticalContentAlignment="Center"
                                                             AutoCompleteSource="{Binding ProductHierarchies}"
                                                             SearchItemPath="Name_Short"
                                                             SelectedItem="{Binding SelectedItem_ProductHierarchy, Mode=TwoWay}"
                                                             TextHighlightMode="FirstOccurrence"
                                                             HighlightedTextColor="Red"
                                                             SuggestionBoxPlacement="Top"
                                                             Height="27">
                                        <syncfusion:SfTextBoxExt.AutoCompleteItemTemplate>
                                            <DataTemplate>
                                                <StackPanel Orientation="Horizontal">
                                                    <TextBlock Text="{Binding Name_Short}" Margin="5 2"/>
                                                </StackPanel>
                                            </DataTemplate>
                                        </syncfusion:SfTextBoxExt.AutoCompleteItemTemplate>
                                        <syncfusion:SfTextBoxExt.ToolTip>
                                            <ToolTip DataContext="{Binding PlacementTarget, RelativeSource={RelativeSource Self}}">
                                                <StackPanel Orientation="Vertical">
                                                    <TextBlock Text="{Binding SelectedItem.Name_Long}" FontWeight="Bold" />
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="de" FontSize="8" FontWeight="Bold" Background="AliceBlue" Width="10"/>
                                                        <TextBlock Text="{Binding SelectedItem.Description_DE}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="en" FontSize="8" FontWeight="Bold" Background="AliceBlue" Width="10"/>
                                                        <TextBlock Text="{Binding SelectedItem.Description_EN}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="fr" FontSize="8" FontWeight="Bold" Background="AliceBlue" Width="10"/>
                                                        <TextBlock Text="{Binding SelectedItem.Description_FR}" />
                                                    </StackPanel>
                                                </StackPanel>
                                            </ToolTip>
                                        </syncfusion:SfTextBoxExt.ToolTip>
                                        <syncfusion:SfTextBoxExt.SuggestionBoxStyle>
                                            <Style TargetType="{x:Type syncfusion:AutoComplete}">
                                                <Setter Property="ToolTip" Value="{StaticResource ResourceKey=comboBoxToolTip}" />
                                                <Setter Property="IsHitTestVisible" Value="{Binding IsChecked, Converter={StaticResource negateBoolConverter}, ElementName=ckbConfirmProductManager}" />
                                                <Setter Property="IsTabStop" Value="{Binding IsChecked, Converter={StaticResource negateBoolConverter}, ElementName=ckbConfirmProductManager}" />
                                            </Style>
                                        </syncfusion:SfTextBoxExt.SuggestionBoxStyle>
                                    </syncfusion:SfTextBoxExt>      


With this as template:

    <StackPanel x:Key="comboBoxToolTip">
        <StackPanel Orientation="Vertical">
            <TextBlock Text="{Binding Name_Long}" FontWeight="Bold" />
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="de" FontSize="8" FontWeight="Bold" Background="AliceBlue" Width="10"/>
                <TextBlock Text="{Binding Description_DE}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="en" FontSize="8" FontWeight="Bold" Background="AliceBlue" Width="10"/>
                <TextBlock Text="{Binding Description_EN}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="fr" FontSize="8" FontWeight="Bold" Background="AliceBlue" Width="10"/>
                <TextBlock Text="{Binding Description_FR}" />
            </StackPanel>
        </StackPanel>
    </StackPanel>


Is this even possible?


Thank you very much :-)


Victor

Hemalatha Marikumar [Syncfusion]
Replied On December 5, 2019 12:13 PM UTC

Hi Victor Dienstbier, 
  
Greetings from Syncfusion. 
  
We have analyzed your requirement “Show ToolTip in SuggestionBox” in SfAutoComplete and you can achieve your requirement by using AutoCompleteItemTemplate as per in below code snippet 
 
Code Snippet[XAML]


 
  <editors:SfTextBoxExt HorizontalAlignment="Center" 
                                     VerticalAlignment="Center" 
                                     Width="400" 
                                     SearchItemPath="Name" 
                                     AutoCompleteMode="Suggest" 
                                     AutoCompleteSource="{Binding Employees}" > 
            <editors:SfTextBoxExt.AutoCompleteItemTemplate> 
                <DataTemplate> 
                    <StackPanel Orientation="Horizontal"> 
                        <TextBlock Text="{Binding Name}" Margin="5 2"> 
                            <TextBlock.ToolTip> 
                                <StackPanel> 
                                    <TextBlock Text="{Binding Email}"/> 
                                </StackPanel> 
                            </TextBlock.ToolTip> 
                        </TextBlock> 
                    </StackPanel> 
                </DataTemplate> 
            </editors:SfTextBoxExt.AutoCompleteItemTemplate> 
        </editors:SfTextBoxExt> 
 
Sample Link: 


Please check the sample and let us know whether your requirement meets with that sample if not please share more details like any video / pictorial representation check further and provide a possible workaround. 
 
Regards, 
Hemalatha M. 


Victor Dienstbier
Replied On December 5, 2019 03:35 PM UTC

That worked perfectly :-)


Thank you very much!


Victor

Hemalatha Marikumar [Syncfusion]
Replied On December 6, 2019 06:46 AM UTC

Hi Victor Dienstbier, 
 
Thanks for your update. 
 
We glad to hear that given solution works. 
 
Please let us know if you need any further assistance. 
 
Regards, 
Hemalatha M. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon