I'm trying to set a tooltip for a row in a XamDataGrid. Can be done?I want it when the mouse moves over the record tooltips becomes visible. Can somebody help me? Thanks
How to set the tooltip from Code. I am facing problem in setting tooltip from code. last style is getting appl;ied to the column header.
Thanks,
Vinod
Hy Josh.
This work's perfect. Thanks so very much.
Nico
Good question, Nico. Here's the solution I came up with for you:
<igDP:XamDataGrid x:Name="xamDG" DataSource="{Binding}" > <igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:LabelPresenter}"> <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Field.(ToolTipService.ToolTip)}" /> </Style> </igDP:XamDataGrid.Resources> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="Name" ToolTipService.ToolTip="The person's name" /> <igDP:Field Name="Age" ToolTipService.ToolTip="The person's age" /> <igDP:Field Name="Status" ToolTipService.ToolTip="The person's marital status" /> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts></igDP:XamDataGrid>
Josh
Thanks so very much for the answer. This is a solution but I will have to define this style for every field.
Is it possible to have a generic one and bind the value for the ToolTip to somethig? I meen something like this: have the style define for the LabelPresenter, a setter for the ToolTip property and the value of the ToolTip will be binded to a property of the field (maybe the Tag property). In this way, it will be enough to set the "Tag" peoperty of the Field and it will know that this will be the value for the ToolTip.
<Style x:Key="GridHeader" TargetType="{x:Type dataPresenter:LabelPresenter}"> <Setter Property="ToolTip" Value="{some property of the Field to bind it to, maybe the Tag of the Field}"/></Style>
<igDP:Field Name="Greetings" Tag="Some tooltip"/>
I tried this but I was not able to make it work. I used also the Ancestor but it was the same. Please if you have questions let me know and I will try to explain better what I want to do. Thanks again.
Nico,
You can specify a tooltip on a field label by setting the FieldSetting's LabelPresenterStyle like so:
<igDP:Field Name="Greetings"> <igDP:Field.Settings> <igDP:FieldSettings> <igDP:FieldSettings.LabelPresenterStyle> <Style TargetType="{x:Type igDP:LabelPresenter}"> <Setter Property="ToolTip" Value="Hello, World!" /> </Style> </igDP:FieldSettings.LabelPresenterStyle> </igDP:FieldSettings> </igDP:Field.Settings></igDP:Field>