MudBlazor/MudBlazor

Add SelectionMode parameter to MudDataGrid for selection behavior consistency

开放

#11,346 创建于 2025年5月16日

 (11 条评论) (0 个反应) (0 位负责人)C# (1,631 个派生)batch import
breaking changeenhancementhelp wanted

仓库指标

星标
 (10,394 个星标)
PR 合并指标
 (平均合并 6天 6小时) (30 天内合并 108 个 PR)

描述

Things to check

  • I have searched the existing issues for this bug
  • To rule out a caching problem I made sure the bug also happens in an incognito tab

Bug type

Component

Component name

MudDataGrid

What happened?

I've setup MudDataGrid's RowClassFunc so that a clicked row is highlighted using CSS classes. When a highlighted row is clicked for a 2nd time, MudDataGrid's SelectedItem property is null

Expected behavior

When a highlighted row is clicked for a 2nd time, MudDataGrid's SelectedItem should not be null, but must contain that last clicked item.

Reproduction link

https://try.mudblazor.com/snippet/waQJaplgxVjBbZFN

Reproduction steps

  1. Click on a row to highlight
  2. Click the same row again to trigger a NRE.

Relevant log output

Version (bug)

8.6.0

Version (working)

No response

What browsers are you seeing the problem on?

Edge

On which operating systems are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

贡献者指南