Hi guys,
Does anybody have any idea regarding it?
Column="5" Name="Date1" Label="Date1" BindingPath="Date1"
ToolTip="Date1 is good"
BindingMode="OneWay">
AllowEdit="False" CellWidth="60"/>
Thanks in advance.
Hello Xiaofeng,
Thank you for contacting Infragistics. You might want to try performing TooltipService.SetIsEnabled(CellValuePresenter, true);
For more details, please visit the sample attached to this post:https://infragistics.com/community/forums/p/83167/415670.aspx#415670
Alternatively, you will need to access the Field's Settings and create a new Style targeting the CellValuePresenter in order to change the tooltip for each field.
<igDP:FieldSettings> <igDP:FieldSettings.CellValuePresenterStyle> <Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="ToolTip"> <Setter.Value> <StackPanel> <TextBlock Text="{Binding DataItem.ID}"/> <TextBlock Text="{Binding DataItem.Name}"/> <TextBlock Text="{Binding DataItem.Age}"/> </StackPanel> </Setter.Value> </Setter> </Style> </igDP:FieldSettings.CellValuePresenterStyle>
<igDP:FieldSettings>
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="ToolTip">
<Setter.Value>
<StackPanel>
<TextBlock Text="{Binding DataItem.ID}"/>
<TextBlock Text="{Binding DataItem.Name}"/>
<TextBlock Text="{Binding DataItem.Age}"/>
</StackPanel>
</Setter.Value>
</Setter>
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
Let me know if you have any questions.
Hi Micheal,
Now, I can set the tooltip for the header of a column in grid using the method mentioned in post below
https://www.infragistics.com/community/forums/t/7885.aspx
The issue is the column style is override which mean the column has a different background/behavior when cursor hover.
Do you have any idea to not change the default style but only set the tooltip?
<igDP:UnboundField x:Uid="LPIDate" Row="0" Column="5" Name="Date1" Label="Date1" BindingPath="Date1" BindingMode="OneWay"> <igDP:UnboundField.Settings>
<igDP:FieldSettings x:Uid="igDP:FieldSettings_8" AllowEdit="False" CellWidth="60"> <igDP:FieldSettings.LabelPresenterStyle> <Style x:Uid="Style_1" TargetType="{x:Type igDP:LabelPresenter}"> <Setter x:Uid="Setter_1" Property="ToolTip" Value="Hello, World!" /> </Style> </igDP:FieldSettings.LabelPresenterStyle> </igDP:FieldSettings> </igDP:UnboundField.Settings> </igDP:UnboundField>
Thank you for following up. Are you using a built-in theme on the XamDataGrid and want to retain the same format? If so, you can use the BasedOn property on the label presenter to keep the same style.
eg.
var labelStyle = new Style(typeof(LabelPresenter));labelStyle.BasedOn = DataPresenterOffice2013.LabelPresenter;
Let me know if you have any questions. Please provide a mockup screenshot of the issue if you still have questions or concerns. Thanks.
Hi Michael,
Thank you for your reply.
It is quite a simple grid which has several column text/date/checkbox. I need to add tooltip for one of the column header.
The grid uses the default theme. But the following markup change the original format.
Can I set the BasedOn property in the markup?
I don't konw how to set it by C# code.
<igDP:UnboundField x:Uid="LPIDate" Row="0"Column="5"Name="Date1"Label="Date1"BindingPath="Date1"BindingMode="OneWay"><igDP:UnboundField.Settings>
<igDP:FieldSettings x:Uid="igDP:FieldSettings_8"AllowEdit="False"CellWidth="60"><igDP:FieldSettings.LabelPresenterStyle><Style x:Uid="Style_1" TargetType="{x:Type igDP:LabelPresenter}"><Setter x:Uid="Setter_1" Property="ToolTip" Value="Hello, World!" /></Style></igDP:FieldSettings.LabelPresenterStyle></igDP:FieldSettings></igDP:UnboundField.Settings></igDP:UnboundField>
Hello,
I attached a sample with a label presenter setting the ToolTip property and didn't notice any issues. Please let me know if there are any issues with the ToolTip in the sample and/or clarify your requirements. The BasedOn property is only intended for elements you wish to include/exclude when applying a theme.
Thanks for your reply.
It does help me a lot.