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

DataGrid with ComboBoxColumn Selection Issue #3982

Closed
joru1407 opened this issue Nov 27, 2020 · 4 comments · Fixed by #3983
Closed

DataGrid with ComboBoxColumn Selection Issue #3982

joru1407 opened this issue Nov 27, 2020 · 4 comments · Fixed by #3983
Labels
Milestone

Comments

@joru1407
Copy link

joru1407 commented Nov 27, 2020

Describe the bug

DataGridComboBoxColumn's behave unexpected when using them in a DataGrid the MVVM way and scrolling around trough the rows of the DataGrid after MahApps Version 2.0.1. In the first X rows the first List Entry of the ComboBoxes get's randomly selected. This change also affects the MVVM Objects behind the DataGrid. If you scroll down and up a little bit, this wrong selection is appearing and diasappearing. WIth Version 2.0.1 everything ist working as expected.

Steps to reproduce

  1. .NET Core 3.1 Project with MahApps 2.0.1 and MahApss.Window
  2. Create a Observable Collection containing Objects and bind it to a DataGrid
  3. DataGrid shoud contain a bound TextBoxColumn and a ComboBoxColumn
  4. ItemSource of the COmboBoxColumn is a StaticResource, SelectedValuePath and SelectedValueBinding are set
  5. Fill the DataGrid and the ComboBox List with Objects during runtime (300 f.e.)
  6. Everything works as expected (in every Row theres's nothing selected in the ComboBox, and you can select it)
  7. Upgrade MahApps to a newer Version trough NuGet
  8. Now there is randomly the first Value ov the ComboBox Selected in the upper 10 or 12 rows f.e.
  9. If you scroll up- or down the DataGrid this wrong selection is appearing and disappearing

This Problem seems not to be related with any other code, Events or the MVVM Models itself. JUst replacing the MahApps Version with an older one solves the problem.

MahApps.Metro version: v2.1.0 or newer
Windows build number: Win10 2004
Visual Studio: 2019 16.8.2
Target Framework: .Net Core 3.1


## Screenshots

![](https://user-images.githubusercontent.com/65429097/100463961-fd88e180-30cc-11eb-826f-10ae77db6d4b.gif)
@joru1407 joru1407 added the Bug label Nov 27, 2020
@timunie
Copy link
Collaborator

timunie commented Nov 27, 2020

@joru1407 may I ask you to provide a sample App via github Repro showing your issue? I don't see the issue on my side right now.

Thanks and happy coding
Tim

@joru1407
Copy link
Author

joru1407 commented Nov 27, 2020

@timunie Attached you can find a simple App showing the Problem.
Just select a value in the first row's ComboBox and scroll up and down a little bit ;-)

If you just downgrade the NuGet Package of MahApps to 2.0.0 everything work's fine.

Greetings,
Joshua

DataGridIssue.zip

@punker76
Copy link
Member

@joru1407 I got it, it's a bug in our default ComboBox style for the DataGrid column.

@punker76 punker76 added this to the 2.4.0 milestone Nov 27, 2020
punker76 added a commit that referenced this issue Nov 27, 2020
Set IsSynchronizedWithCurrentItem to false by default.
@joru1407
Copy link
Author

@punker76 Wow, that was quick! Thank you very much, Joshua

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

Successfully merging a pull request may close this issue.

3 participants