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

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

Open
lendres opened this issue Apr 17, 2024 · 4 comments

Comments

@lendres
Copy link

lendres commented Apr 17, 2024

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
@symbiogenesis
Copy link
Collaborator

Try the latest main branch. I think this is probably just related to #171

@lendres
Copy link
Author

lendres commented Apr 18, 2024

I downloaded the latest main after your submission of the 171 fix (downloaded on April 17th). I confirmed the sorting was fixed, but this issue seemed to remain.

@symbiogenesis
Copy link
Collaborator

Thank you for the report. I will look at it.

@symbiogenesis
Copy link
Collaborator

I can reproduce the problem. I am not able to solve it, right now.

MAUI made changes to ensure that the virtualization on the CollectionView is happening, but this seems to have introduced some bugs.

We may need to build a minimal reproducible test case and then send it to the MAUI team. They like the test cases to be as simple as possible.

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

2 participants