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

MetroDataGridCheckBox cell can be changed when IsReadOnly via keyboard + space #2788

Closed
ptownsend1984 opened this Issue Jan 4, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@ptownsend1984

ptownsend1984 commented Jan 4, 2017

What steps will reproduce this issue?

Simple to reproduce. Run the MahApps.Metro.Demo.NET45 application and go to the DataGrid tab. Click on a row in the top Album grid's ISSELECTED column. Press TAB then SPACE. The checkbox will toggle once it has focus. Setting the DataGrid to IsReadOnly explicitly in DataGridExamples.xaml doesn't help.

Expected outcome

Should not be able to toggle the checkbox at all when the cell/column/row/grid is read only.

The fix

Need to set Focusable to False in the MetroDataGridCheckBox's style definition in Controls.DataGrid.xaml inside of the IsReadOnly DataTrigger.

<Setter Property="Focusable" Value="False" />

With this done, you cannot tab into the checkbox and toggle it anymore. Will submit a PR shortly.

--

Environment

  • MahApps.Metro 1.4.0.42 (Commit: 225d55a [225d55a])
  • Windows 10 Pro
  • Visual Studio 2015 Community
  • .NET Framework 4.6.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment