So, I am trying to setup a datatrigger for a datagridcell in WPF that shows a red square when the cell contains the word "red". It works but the problem is I am modifying the background and when the row is selected it shows a white box around the square. I want to get rid of the white box and I have been looking for another way of going about what I want but can't figure it out. Below is the code and an example image.
Code:<Style x:Key="dgJobsPriority" TargetType="DataGridCell"> <Style.Triggers> <DataTrigger Binding="{Binding Priority}" Value="Red"> <Setter Property="Background"> <Setter.Value> <DrawingBrush Stretch="None"> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush="Red"> <GeometryDrawing.Geometry> <RectangleGeometry Rect="0,0,16,16" /> </GeometryDrawing.Geometry> </GeometryDrawing> </DrawingGroup> </DrawingBrush.Drawing> </DrawingBrush> </Setter.Value> </Setter> </DataTrigger> </Style.Triggers> <Setter Property="Foreground" Value="#00000000"/> </Style>![]()




Reply With Quote