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

Checkboxes using Dark theme within DataGrid column appear unchecked (Server 2012 R2) #3840

Closed
webprofusion-chrisc opened this issue Jun 6, 2020 · 10 comments · Fixed by #3841
Assignees
Labels
Milestone

Comments

@webprofusion-chrisc
Copy link
Contributor

Describe the bug

On Windows Server 2012 R2, using a Dark theme, checked DataGridCheckBoxColumn appears unchecked.

Steps to reproduce

On Windows Server 2012 R2, using a Dark theme,

 <DataGridCheckBoxColumn Binding="{Binding IsSelected}" Header="Include" />

Or, download https://certifytheweb.com, add a contact using New Certificate, then Add new Certificate with at least one domain. Include column should be checked in light or dark mode (changed under settings).

Expected behavior

image

Actual behavior

The checkboxes in this image are checked, but they don't look it until the theme is set back to light.

image

Environment

MahApps.Metro version: v2.0.1
Windows build number:  Windows 2012 R2 standard (via AWS lightsail)
Visual Studio: 2019 16.7.0
Target Framework: v4.6.2

Originally posted by @webprofusion-chrisc in #3833 (comment)

@punker76
Copy link
Member

punker76 commented Jun 6, 2020

@webprofusion-chrisc It seems like that you use a different style for the CheckBox. So can you show this style?

@webprofusion-chrisc
Copy link
Contributor Author

@punker76 hmm, I do? Maybe! I did have a couple of naive style hacks (some of the borders were too white and the tab item grey was hard to read) but I don't know if they are affecting this:

https://github.com/webprofusion/certify/blob/development/src/Certify.UI/App.xaml

This is the actual usage in-situ: https://github.com/webprofusion/certify/blob/65e7257b50358e885d1f1bd26b8c6773d299522a/src/Certify.UI/Controls/ManagedCertificate/CertificateDomains.xaml#L218

@punker76
Copy link
Member

punker76 commented Jun 6, 2020

@webprofusion-chrisc Oh I see, you don’t use autogenerated columns, so you need to set the style for the CheckBox column like in this sample

https://github.com/MahApps/MahApps.Metro/blob/5a79c0479496c73291858685cb20b81c3adc0f39/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/DataGridExamples.xaml

EditingElementStyle="{DynamicResource MahApps.Styles.CheckBox.DataGrid}"
ElementStyle="{DynamicResource MahApps.Styles.CheckBox.DataGrid}"

@webprofusion-chrisc
Copy link
Contributor Author

Thanks! I just figured this out at the exact same time, I reproduced it using the MahApps.Metro.Demo and removing those attributes. I'll do that. Does this still count as a bug (i.e. should there be a default instead of just not being set)?

@timunie
Copy link
Collaborator

timunie commented Jun 6, 2020

@webprofusion-chrisc I think this is not possible due to the way the DataGrid is implemented. 🙁

@punker76
Copy link
Member

punker76 commented Jun 6, 2020

@webprofusion-chrisc @timunie I found a way to do this.

@timunie
Copy link
Collaborator

timunie commented Jun 6, 2020

@punker76 Did you ask Chuck Norris? I read abot it on a MS page that said it is not possible.

If it works this would be a huge improvement.

@punker76 punker76 self-assigned this Jun 6, 2020
@punker76 punker76 added this to the 2.0.2 milestone Jun 6, 2020
@webprofusion-chrisc
Copy link
Contributor Author

Chuck Norris doesn't implement data grid improvements, the IL reconfigures dynamically according to his will.

punker76 added a commit that referenced this issue Jun 7, 2020
punker76 added a commit that referenced this issue Jun 7, 2020
Introduce new DataGridColumnStylesHelperExtension to enable auto generated column styles. It implements a IDataGridColumnStylesHelper interface to allow using custom defined helpers.

- Adds new style MahApps.Styles.TextBlock.DataGrid
punker76 added a commit that referenced this issue Jun 8, 2020
- Add AutoGeneratedComboBoxColumnStyle and AutoGeneratedComboBoxColumnEditingStyle attached properties
- Add new style MahApps.Styles.ComboBox.DataGrid
punker76 added a commit that referenced this issue Jun 8, 2020
- Add AutoGeneratedNumericUpDownColumnStyle and AutoGeneratedNumericUpDownColumnEditingStyle attached properties
- Use real default styles (without looking for a base style)
punker76 added a commit that referenced this issue Jun 8, 2020
- Fix style key `MahApps.Styles.NumericUpDown.DataGridColumn` to `MahApps.Styles.NumericUpDown.DataGrid`
- Fix style key `MahApps.Styles.NumericUpDown.DataGridColumnEditing` to `MahApps.Styles.NumericUpDown.DataGrid.Editing`
punker76 added a commit that referenced this issue Jun 9, 2020
punker76 added a commit that referenced this issue Jun 9, 2020
Introduce new DataGridColumnStylesHelperExtension to enable auto generated column styles. It implements a IDataGridColumnStylesHelper interface to allow using custom defined helpers.

- Adds new style MahApps.Styles.TextBlock.DataGrid
punker76 added a commit that referenced this issue Jun 9, 2020
- Add AutoGeneratedComboBoxColumnStyle and AutoGeneratedComboBoxColumnEditingStyle attached properties
- Add new style MahApps.Styles.ComboBox.DataGrid
punker76 added a commit that referenced this issue Jun 9, 2020
- Add AutoGeneratedNumericUpDownColumnStyle and AutoGeneratedNumericUpDownColumnEditingStyle attached properties
- Use real default styles (without looking for a base style)
punker76 added a commit that referenced this issue Jun 9, 2020
- Fix style key `MahApps.Styles.NumericUpDown.DataGridColumn` to `MahApps.Styles.NumericUpDown.DataGrid`
- Fix style key `MahApps.Styles.NumericUpDown.DataGridColumnEditing` to `MahApps.Styles.NumericUpDown.DataGrid.Editing`
punker76 added a commit that referenced this issue Jun 11, 2020
- Add new default style for Hyperlink MahApps.Styles.Hyperlink
punker76 added a commit that referenced this issue Jun 11, 2020
- Add AutoGeneratedHyperlinkColumnStyle and AutoGeneratedHyperlinkColumnEditingStyle attached properties
- Add new style MahApps.Styles.Hyperlink.DataGrid
punker76 added a commit that referenced this issue Jun 12, 2020
…tedColumnStyles

(GH-3840) DataGrid auto generated column styles
@punker76
Copy link
Member

@webprofusion-chrisc this has now been fixed, and it will be released in the next version of MahApps.Metro

@webprofusion-chrisc
Copy link
Contributor Author

@punker76 fantastic! Much appreciated, I know this was quite complicated but hopefully it makes it easier for people to use.

@punker76 punker76 modified the milestones: 2.0.2, 2.1.0 Jun 16, 2020
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