Ticket T1284204
Visible to All Users

ToolTip of a "DevExpress.Xpf.Editors.ComboBoxEdit" when text is too long but not wrapped

created 5 days ago

Hello

My ComboBoxEdit doen't show the right ToolTip when closed and a line with a longer text than the box width is selected.
I have set ToolTips to each line in the ComboBox. This is working well.
When the text is shorter than the box width, the ToolTip of the line is shown, when the box is closed.
When the text is longer, the normal text of the item is shown in the tooltip.

Here is my code:

Code
<DataTemplate x:Key="IntPropertySelectStyleTemplate"> <localCT:ComboBoxEditWithoutSpinIfNotFocused x:Name="PART_Editor" ShowBorder="False" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsTextEditable="False" ToolTip="{Binding Path=SelectedItem.ToolTip, RelativeSource={RelativeSource Mode=Self}}" DisplayMember="Label" ValueMember="Index" IsEnabled="{Binding Path=RowData.Row.IsPropertyEnabled}" ItemsSource="{Binding Path=RowData.Row.ListIndexes}" EditValue="{Binding Path=RowData.Row.Value_IntPropertySelect, UpdateSourceTrigger=PropertyChanged}" > <dxe:ComboBoxEdit.ItemContainerStyle> <Style TargetType="dxe:ComboBoxEditItem"> <Setter Property="ToolTip" Value="{Binding ToolTip}"/> </Style> </dxe:ComboBoxEdit.ItemContainerStyle> </localCT:ComboBoxEditWithoutSpinIfNotFocused> </DataTemplate>

ToolTipsComboBoxDevExpress.JPG

What can I do?

Thanks for helping
Best regards
Norbert Schmidt, SETEX

Show previous comments (5)
C C
Customer116700 3 days ago

    Hello Andrey

    I'm using Windows 11 with DPI 100%.

    Regards,
    Norbert

    C C
    Customer116700 3 days ago

      I made a video of the behavior.

      The problem is on all of our computers.

      Regards,
      Norbert

      C C
      Customer116700 3 days ago

        Hello Andrey

        I have updated DevExpress in a sandbox, first to v24.1.11 and then to v24.2.6.

        Both new versions show the same error behavior on my computer.

        Best regards,
        Norbert

        Answers approved by DevExpress Support

        created 3 days ago

        Hello Norbert,

        Thank you for the update and video. When I read your previous message, I assumed you meant cropped ToolTips. However, now I see that the issue occurs because the value that ToolTip displays is not from a data item's ToolTip property. Please accept my apologies for missing that fact.

        In your video, I indeed see that ComboBoxEdit sometimes displays a value from a data item's Name property. This is exactly how the editor works when the ShowTooltipForTrimmedText property is enabled. I also see this behavior in this case. However, once I disable the option, I always see values from a data item's ToolTip property. Please refer to the attached project and screencast.

        Please disable the ShowTooltipForTrimmedText property in your real application and let me know if this helps.

        Alternatively, you can keep this property enabled but define a custom TrimmedTextToolTipContentTemplate:

        XAML
        <dxe:ComboBoxEdit.TrimmedTextToolTipContentTemplate> <DataTemplate> <TextBlock Text="{Binding RelativeSource={RelativeSource Self}, Path=(dxe:BaseEdit.OwnerEdit).SelectedItem.ToolTip}"/> </DataTemplate> </dxe:ComboBoxEdit.TrimmedTextToolTipContentTemplate>

        Just in case, I use the attached BaseEdit.OwnerEdit property in this binding definition to get access to the parent ComboBoxEdit in the TextBlock element declared in the DataTemplate.

        Please try these changes in your application and let me know if they help.

        Regards,
        Andrey

          Comments (1)
          C C
          Customer116700 2 days ago

            Hello Andrey

            Now I'm using the "TrimmedTextToolTipContentTemplate".
            This works, thank you for your help !

            I have just another question:
            In some cases I have to disable the "ComboBoxEdit" in my list.
            Then there is no ToolTip displayed.
            Is there a possibility to display the ToolTop even if the control editor is disabled ?
            I've changed your example project for this requirement.

            Best regards,
            Norbert

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.