0
votes

I am trying to drop shadow on a wpf datagrid row background color
What i tried is to set the datagrid row style but i`m kinda stuck there
I can set the background property to some color or even a gradient color, but i can't seem to drop shadow on that color
I am trying to make the row background less flat

<Style TargetType="DataGridRow">
    <Setter Property="Background" Value="....." />
1
Can you give us a picture of what you want to accomplish? - Emond Erno
Something like this: link but only with grid rows, my row color is a binded property so i need the shadow to drop on whatever color the row have - gil kr

1 Answers

1
votes

This works fine:

<DataGrid.RowStyle>
    <Style TargetType="DataGridRow">
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{Binding color}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect BlurRadius="50" Color="{Binding color}"/>
            </Setter.Value>
        </Setter>
    </Style>
</DataGrid.RowStyle>

Although I don't know what you're trying to accomplish; the drop shadows from each row blend into each other and obscure the row text :-/

enter image description here