hi,
i had set following styles in xamdatagrid resources
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="BorderThickness" Value="0,1,0,1"></Setter> <Setter Property="BorderBrush" Value="LightGray"></Setter> <Style.Triggers> <Trigger Property="IsRecordSelected" Value="True"> <Setter Property="BorderBrush" Value="Transparent"></Setter> <Setter Property="BorderThickness" Value="0,1,0,1"></Setter> </Trigger>
</Style.Triggers> </Style>
<Style TargetType="{x:Type igDP:DataRecordCellArea }"> <Setter Property="BackgroundActive"> <Setter.Value> <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1"> <GradientStop Color="Gray" Offset="0.569"/> <GradientStop Color="#FF504E4C" Offset="0.138"/> </LinearGradientBrush> </Setter.Value> </Setter> <Setter Property ="BackgroundHover" Value="Transparent"></Setter> <Setter Property="BackgroundActive"> <Setter.Value> <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1"> <GradientStop Color="Gray" Offset="0.569"/> <GradientStop Color="#FF504E4C" Offset="0.138"/> </LinearGradientBrush> </Setter.Value> </Setter>
<Setter Property="BorderBrush" Value="Transparent"></Setter> </Style>
when i select one row, selected row changes its foreground as my requirement(dark gradient).the problem is i want to set cell text color to white when i select row.
Regards,
Jafar VM
Hello Jafar,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
hi stefan,
thanks for ur post and it solved my issue..
Thank you for your post. I have been looking into it and I can suggest you use the following style for the CellValuePresenter instead of yours:
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="BorderThickness" Value="0,1,0,1"></Setter> <Setter Property="BorderBrush" Value="LightGray"></Setter> <Style.Triggers> <Trigger Property="IsRecordSelected" Value="True"> <Setter Property="BorderBrush" Value="Transparent"></Setter> <Setter Property="BorderThickness" Value="0,1,0,1"></Setter> <Setter Property="ForegroundStyle"> <Setter.Value> <Style> <Setter Property="TextBlock.Foreground" Value="White"/> </Style> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style>
Basically I added a Setter for the ForegroundStyle in the Trigger for the IsRecordSelected Property in order to change the foreground to white as per your requirement. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.