Ticket T444164
Visible to All Users

ToolTip cannot have a logical or visual parent

created 8 years ago

Hi,

We are experiencing what appears to be a random issue that is becoming more prevalent. In our app we have a WPF GridControl together with a DXContentMenu within it. If an item with the content menu is disabled we want to provide an explanation, as such each BarButtonItem within the menu has it's Tooltip bound to a string property which is updated within the underlying ViewModel; below is a sample of a BarButtonItem.

XAML
<dxb:BarButtonItem Content="{Binding Commands.AckCommand.CommandDescription}" CommandParameter="{Binding SelectedOrders}" ToolTip="{Binding Commands.AckCommand.DisabledReason}" Command="{Binding Commands.AckCommand, Mode=OneTime}" />

Occasionally an exception is being raised with the message System.InvalidOperationException: 'ToolTip' cannot have a logical or visual parent.

From the attached stack trace line #62, you can see that the we are updating the DisabledReason property on the ViewModel. Continuing up the call stack you can see

- line #41 it enters DevExpress code
- line #40 calls DevExpress.Xpf.Bars.BarItem.OnToolTipChanged()
- line #31 call BarItemLinkControl.UpdateToolTip()

I have seen two other issues in the forum as below but these are from some time ago
https://www.devexpress.com/Support/Center/Question/Details/T235569
https://www.devexpress.com/Support/Center/Question/Details/B142608

Any assistance resolving this exception would be appreciated.

Thanks
Fahad

Comments (1)
DevExpress Support Team 8 years ago

    Hello Fahad,

    It is difficult to provide a precise solution based only on the posted call stack. It would be helpful if you provide us with step-by-step instructions how to replicate the issue. Alternatively, you can modify the attached sample project which I created while trying to replicate the exception on my side. I'm looking forward to your reply.

    Thanks,
    Michael

    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.