Skip to content

ListView EditItemTemplate doesn't render when EditIndex changes #406

@csharpfritz

Description

@csharpfritz

Bug

When clicking an Edit button in a ListView with EditItemTemplate defined, the ItemEditing event fires correctly but the ListView does not visually swap from ItemTemplate to EditItemTemplate for the edited row.

Steps to Reproduce

  1. Navigate to /ControlSamples/ListView/CrudOperations
  2. Click the Edit button on any row
  3. Status changes to 'Editing item X' (callback fires correctly)
  4. Row still shows Edit/Delete buttons instead of Update/Cancel (template doesn't swap)

Analysis

HandleEditCommand correctly fires ItemEditing, sets EditIndex, and calls StateHasChanged(). But the re-render doesn't pick up the changed EditIndex for template selection at line 59 of ListView.razor.

Files

  • src/BlazorWebFormsComponents/ListView.razor (line 59)
  • src/BlazorWebFormsComponents/ListView.razor.cs (line 282-288)
  • samples/AfterBlazorServerSide/Components/Pages/ControlSamples/ListView/CrudOperations.razor

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions