Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Changing Checkbox requires three mouse clicks in DataGridCheckBoxColumn #3438

Closed

Description

@Marv51

Describe the bug

Changing a Checkbox in a DataGridCheckBoxColumn in a DataGrid requires the user to click on the checkbox three times.
Presumably once to select the row, then enter edit mode and then again to change checkbox value. This is very unexpected behavior.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

Steps to reproduce the behavior:

xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
...
 <controls:DataGrid AutoGenerateColumns="False" ItemsSource="{x:Bind MyObservableCollection }">
                    <controls:DataGrid.Columns>
                        <controls:DataGridCheckBoxColumn Width="100" CanUserResize="False" CanUserSort="False" CanUserReorder="False" Binding="{Binding Checked, Mode=TwoWay}" />
                    </controls:DataGrid.Columns>
                </controls:DataGrid>

Expected behavior

Clicking twice (or maybe once) exactly on the checkbox changes it's state. (Selecting the row & cell, then click again to editing it).
It might also be a good idea to introduce a property to select the desired behavior (once, twice or three times).

Especially checking boxes of a bunch of rows one after the other leads to a very slow and bad user experience.

For context: In my case the checkboxes are meant to enable the user to (de)select rows they don't want during a CSV import into my app.

Screenshots

checkbox

Environment

NuGet Package(s): 
Microsoft.NETCore.UniversalWindowsPlatform v6.2.10
Microsoft.Toolkit.Uwp.UI.Controls v6.1.1
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid v6.1.1
Microsoft.UI.Xaml v2.4.3

Package Version(s): ?

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [min] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [target] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: 16.7) 
- [x] 2019 Preview (version: 16.8 preview 1)

Additional context

Only tested interaction with mouse (not touch)

Activity

  1. added
    bug 🐛An unexpected issue that highlights incorrect behavior
    on Aug 18, 2020
  2. Kyaa-dost commented on Aug 18, 2020

    @Kyaa-dost
    Contributor

    @Marv51 Thanks for highlighting the issue. The behavior in this scenario is similar to #3161

    @anawishnoff @RBrid for visibility ⬆️

  3. michael-hawker commented on Aug 18, 2020

    @michael-hawker
    Member

    Yeah, I think this is a general problem that's been highlighted with the DataGrid and how it's interaction behaviors are designed.

    I think we can close this as a duplicate? @anawishnoff we should make sure to solve this for the new datagrid overall to make editing easier/more fluid.

    In the meantime, I'm not sure what can be done in the existing code-base without a lot of work? @RBrid do you know if there's a simple solution or if this is more ingrained with how it's currently built?

    Thanks

  4. RBrid commented on Aug 18, 2020

    @RBrid
    Contributor

    @michael-hawker, @anawishnoff, unfortunately there is no quick fix for this behavior. It's the same story as for the combo box column: first click makes the cell current, second click enters editing mode, third click switches the value.
    In the new control, we could have a column-level property like column.CurrentCellEntersEditing=true;

  5. Marv51 commented on Aug 19, 2020

    @Marv51
    ContributorAuthor

    Hi, thanks for looking at this so quickly!

    Is there any work-around people have found to this? Can I enter edit-mode programmatically on selection?

    Otherwise, I guess I will have to change to an ItemsRepeater, which unfortunately misses many of the features in a GridView.

    I would consider this an important issue, but from what people are saying it seems a bit more complex to fix than I am able to invest into this right now.

  6. michael-hawker commented on Aug 19, 2020

    @michael-hawker
    Member

    Thanks @RBrid. Like that idea of the property proposal in the future. It may also just make sense to have a property on the Grid itself to signal if the Grid is mean to be a read-only display of data vs. a table that people expect to edit as well (where you're basically always in edit mode as you navigate around the table).

    @Marv51 I don't know if anyone's tried, but you may want to quickly try hooking into the mouse or selection events and see if you can just call BeginEdit to see its behavior.

  7. removed
    bug 🐛An unexpected issue that highlights incorrect behavior
    on Sep 16, 2020
  8. RBrid commented on Sep 16, 2020

    @RBrid
    Contributor

    Removed this bug label since this behavior is by design for this DataGrid control.

  9. Kyaa-dost commented on Sep 16, 2020

    @Kyaa-dost
    Contributor

    @RBrid Thanks! Closing the issue as it seems to be a duplicate and the feature intended by design.

  10. ghost locked as resolved and limited conversation to collaborators on Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DataGrid 🔠Issues on DataGrid controlduplicate 👥Indicates that identical Issue or PR already exist

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions