Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] DataGrid row background still not working properly #404

Open
1 task done
sn4k3 opened this issue Feb 11, 2025 · 0 comments
Open
1 task done

[Bug] DataGrid row background still not working properly #404

sn4k3 opened this issue Feb 11, 2025 · 0 comments

Comments

@sn4k3
Copy link
Contributor

sn4k3 commented Feb 11, 2025

Check the following items

  • I have looked up relevant Issue

Description of the issue

After the new release I tested the grid row background and it works at 50%...
Meaning that is only possible to style rows in alternate manner, even if style is applied to whole table:

Image

Package Version

6.0.0

Environment

Windows 11

Expected Behavior

Able to set the background in every row and not in an odd/even fashion.

Reproduction

Add the following style to a DataGrid:

<DataGrid.Styles>
    <Style Selector="DataGridRow">
        <Setter Property="Background" Value="DarkRed" />
    </Style>
</DataGrid.Styles>

Code behind reproduce the same problem:

private void ServicesPingsDataGridOnLoadingRow(object? sender, DataGridRowEventArgs e)
{
     e.Row.Background = Brushes.DarkRed;
}

Additional Information

ControlTheme for RowTheme is still not applied, as so we cant do tricks for dynamic set styles like:

<DataGrid.RowTheme>
    <ControlTheme
        x:DataType="network:PingableService"
        BasedOn="{StaticResource {x:Type DataGridRow}}"
        TargetType="DataGridRow">
        <Setter Property="Background" Value="{Binding WasLastPingSucceeded, Converter={StaticResource BoolErrorGridRowBackground}}" />
    </ControlTheme>
</DataGrid.RowTheme>

Again, I think the DataGrid style should be copied over from Avalonia and restyled to be fully compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant