Hi,
I need to change the text color on hover for entire row; is it possible? I have tried different styles but couldn't get it working properly. it works seperately for each cell; means if I hover on a cell, the text changes color. But I want to change the color of text of entire row on mouse over in the same way as we hover and DataRecordCell area changes color of entire row.
If someone knows how can we do it, please let me know.
Thanks
Adeel
Why is this happening and how can we avoid this?
Regards,
Hi rishi_invar,
We’ve taken a look at this here and there appears to be some strange things happening in the WPF Frameworkwhen it comes to resolving inherited property settings (TextBlock.Foreground in this case). The style you have set up seems perfectly reasonable but that is not having the desired effect due to thisWPF framework weirdness.
What you can do to workaround this issue is to use the solution suggested by Joe Modica and Andrew Smith.Special thanks to both of them for the suggested solution.
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type igDP:DataRecordCellArea}}}" Value="True"> <Setter Property="ForegroundStyle"> <Setter.Value> <Style> <Setter Property="TextBlock.Foreground" Value="Red"/> </Style> </Setter.Value> </Setter> </DataTrigger> </Style.Triggers></Style>
The attached TextBlockForegroundPropertyIssueSolution sample application contains the full solution implementation.
Best Regards,Yanko
I have tried implementing this,and does kind of work, except the text color is not changed to Red but the font size and weight is updated. Is there something i am missing, here is my code:
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:igDP="http://infragistics.com/DataPresenter" Title="Window1" Height="336" Width="619"> <Grid> <igDP:XamDataGrid BindToSampleData="True"> <igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Setter Property="ForegroundHoverStyle"> <Setter.Value> <Style> <Setter Property="TextBlock.FontFamily" Value="Arial" /> <Setter Property="TextBlock.FontSize" Value="15" /> <Setter Property="TextBlock.FontWeight" Value="Bold"/> <Setter Property="TextBlock.Foreground" Value="Red"/> </Style> </Setter.Value> </Setter> <Setter Property="BackgroundHover"> <Setter.Value> <LinearGradientBrush EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#FF2225FF" Offset="0"/> <GradientStop Color="#FFB9D8FF" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property="BorderHoverBrush" Value="#FF000000"/> </Style> </igDP:XamDataGrid.Resources> </igDP:XamDataGrid> </Grid></Window>
You can change the text color (and much more) of entire row on mouse hover. Use the following style.
<igDP:XamDataGrid.Resources>
<Style TargetType="{x:Type igDP:DataRecordCellArea}">
<Setter Property="ForegroundHoverStyle">
<Setter.Value>
<Style>
<Setter Property="TextBlock.FontFamily" Value="Arial" />
<Setter Property="TextBlock.FontSize" Value="15" />
<Setter Property="TextBlock.FontWeight" Value="Bold"/>
<Setter Property="TextBlock.Foreground" Value="Red"/>
</Style>
</Setter.Value>
</Setter>
</igDP:XamDataGrid.Resources>
Best Regards,
I have the same problem, how do you change the hover foreground brush for the entire row?
Cheers