wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

DataGrid Row events don't fire

Open RaoHammas opened this issue 10 months ago • 1 comments

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

RaoHammas avatar Mar 02 '25 17:03 RaoHammas

Something in DefaultDataGridRowStyle appears to break it.

chucker avatar Mar 02 '25 19:03 chucker