Skip to content

Rows background colors not updating correctly when adding/deleting items from observable collection. #172

Open
@lendres

Description

@lendres

Describe the bug
The rows do not seem to maintain the settings of the DataGrid.RowsBackgroundColorPalette correctly when items are added or deleted.

To Demonstrate
I've modified the standard example to demonstrate the issue. The modified version can be found here:
https://github.com/lendres/Maui.DataGrid

The basic steps to create it were:

  1. Create a button on the view page.
  2. Create a delete command in the viewmodel.
  3. Change the "Teams" property and underlying variables to an ObservableCollection.

I also had to change the targeted Windows version to get it to compile.

To Reproduce

  1. Compile and run the modified example.
  2. Turn off the pagination in the settings.
  3. Click the "Delete" button and observe the rows' background colors. After a click or two, you get 3 rows with the same background color.

Expected behavior
Rows should maintain alternate background colors.

Screenshots
datagrid-color-bug

Desktop (please complete the following information):

  • OS: Windows 10.0.19041.0
  • Version 4.0.2 after pull 171 fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions