Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4155
Can't get tooltips for choices inside a XamComboEditor
posted

When displaying a different tooltip per item in a XamComboEditor’s combo box style there is a binding error that displays in the output window. As far as I can tell this error indicates that I cannot use display member path on the XamComboEditor for the selected item as well as bind the combo box style’s text block text property also. If I comment out the display member path I do not get the error but the selected item does not display properly; I see the name of the property and not the contents of the property.

 

How do I properly display the item’s property both in the combo box style and as the CellValuePresenter’s text without the binding error?

XamComboEditorTooltip.zip
Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Travis,

    Thank you for your post!

    The reason you are seeing this error is because you are setting the ItemTemplate of the ComboBox and the DisplayMemberPath property. This error is more like a warning telling you that since both the ContentTemplate and the ContentTemplateSelector are set, the ContentTemplateSelector will be ignored. This error arises because when you set the DisplayMemberPath, this is used to tell the ItemsControl which property to display when showing your objects. When you pass in a custom ItemTemplate, you are choosing how to show the object within that ItemTemplate. In other words, when you set the DisplayMemberPath on the XamComboEditor, it is carrying over to the ComboBox it uses when editing. If you tried setting a DisplayMemberPath and an ItemTemplate on a WPF ComboBox, you would receive this same error.

    To achieve your requirement, I would recommend that you remove the ComboBoxStyle, since you are only setting the tooltip. Then, inside of the XamDataGrid.Resources, write a new style for ComboBoxItem which sets the ToolTip property.

    I have attached a modified version of the sample you sent to demonstrate the above.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamComboEditorTooltip.zip
Children