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
225
How do you add a tooltip to a XamGrid's ImageColumn?
posted

Dear community member.

My XamGrid contains an ImageColumn that us used to display a set of icons.  Each of these icons has a corresponding state (i.e. an enum value).  Ideally I would like to:

  • display an image in the column
  • display the enum value as a tool tip on each image's cell

The following code works great except: the tool tip will start displaying an image (instead of the enum value) if you deserialize the XamGrid using the PersistenceManager.

To recap:

  1. load the XamGrid for the first time
    •  everything works as expected (i.e. tool tip is an enum)
  2. serialize the XamGrid and then deserialize the XamGrid
    • the tool tip now displays an image instead of the enum value

SAMPLE CODE

<ig:ImageColumn Key="Severity" ValueConverter="{StaticResource EventSeverityToImageConverter}" AllowToolTips="Always">                    
                <ig:ImageColumn.ToolTipContentTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Severity}"/>
                    </DataTemplate>
                </ig:ImageColumn.ToolTipContentTemplate>
                <ig:ImageColumn.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock Text="Event Severity"/>
                    </DataTemplate>
                </ig:ImageColumn.HeaderTemplate>
            </ig:ImageColumn>

NOTE: EventSeverityToImageConverter converts the given enumeration value into an image (i.e. *.PNG)

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I can say that the Infragistics Persistence Framework™ does not intrinsically persist certain types of properties (e.g. AttachedProperties, DataTemplates, Paths, ControlTemplates, Styles and ItemPanelTemplates), so you have to use Identifier, since you use DataTempaltes for the header and tooltip. Here you can find more information about this:

     

    http://help.infragistics.com/doc/Silverlight/2013.2/CLR4.0/?page=Persistence_Identifier.html

     

    Please let me know if this helps you or you have further questions on this matter.

     

    Looking forward for your reply.

Children