lepoco / lepoco/wpfui

DataGrid Row events don't fire

Open
#1,370 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Hi,

I'm trying to have row double click functionalty on the datagrid but the events don't fire. In normal WPF the events do fire when set using this way 👇

                <ui:DataGrid
                    Margin="0,10,0,0"
                    AutoGenerateColumns="False"
                    BorderBrush="{DynamicResource ControlStrongFillColorDarkBrush}"
                    BorderThickness="1"
                    CanUserReorderColumns="True"
                    CanUserResizeColumns="True"
                    CanUserSortColumns="True"
                    GridLinesVisibility="All"
                    IsReadOnly="True"
                    ItemsSource="{Binding Clients}"
                    SelectionMode="Single"
                    SelectionUnit="FullRow">
                    <ui:DataGrid.Resources>
                        <Style TargetType="DataGridRow">
                            <EventSetter Event="MouseDoubleClick" Handler="Control_OnMouseDoubleClick" />
                        </Style>
                    </ui:DataGrid.Resources>
                </ui:DataGrid>
To Reproduce
  1. Create a DataGrid
  2. Assign ItemSource
  3. Set Row event
  4. See events don't fire
Expected behavior

Row events must fire.

Screenshots

No response

OS version

Win 11

.NET version

.Net 8

WPF-UI NuGet version

4.0.2

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the DataGrid example from the issue on Windows 11 with .NET 8 and WPF-UI 4.0.2, then trace the DataGrid row event handling. Done means a DataGridRow MouseDoubleClick EventSetter fires when a row is double-clicked, while preserving the reported configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.