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
1280
XamDataGrid - conditional tooltip visualization
posted

Hello,

I need to display in my XamDataGrid a tooltip on one column only. This tooltip will be bound to a property in my ViewModel. Plus, I need the tooltip to be shown only if this property (string) is not null or empty.

I could display the tooltip on my first columns, following suggestions provided here: https://es.infragistics.com/community/forums/t/71444.aspx

However, I cannot find a way to hide the tooltip if the property is null or empty string. 

What I do NOT want is to have an empty tooltip box: I just don;t want the tooltip to appear.

here is my code: The textField column has a tooltip bound to the Description property. I understood that maybe a way to do this is using datatriggers, but I could not find a way to apply the trigger to the tooltip property only (and no to the entire style.. infact the trigger part in my code is commented, since it would hide the whole content of my cell)


<igWPF:TextField Name="AttributeName" Label="{local:Localizer ProfileManager_AttributeName}" Width="*">
<!--Set Tooltip for this cell only-->
<igDP:Field.Settings>
<igDP:FieldSettings>
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="ToolTip">
<Setter.Value>
<TextBlock Text="{Binding DataItem.Description}"/>
</Setter.Value>
</Setter>
<!--<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=DataItem.Description}" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=DataItem.Description}" Value="">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>-->
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igWPF:TextField>




Please, help me to find a solution!

Thanks in advance

best regards

Valentina