---
title: Clear grid pending-change collections
summary: Reset a grid's pending add/delete/update collections after a successful save while preserving displayed rows.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-17
library: SAIF.Framework.Web.Mvc
reference_type: package
operation_id: OP-28
trigger: Controller resetting a grid after a successful save*
---

# Clear grid pending-change collections

Reset a grid's pending add/delete/update collections after a successful save while preserving displayed rows. Trigger: Controller resetting a grid after a successful save*.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-28 |
| **Trigger** | Controller resetting a grid after a successful save* |
| **Inputs** | `GridViewModel<T>` |
| **Outputs** | `Added`, `Deleted`, and `Updated` replaced with empty lists |
| **Primary components** | `GridRowViewModelExtensions.ClearAll<T>(GridViewModel<T>)` |
| **Entry point** | `src/Web.Mvc/ViewModels/GridRowViewModel.cs` |

## Steps

1. Assign new empty `List<T>` instances to `Added`, `Deleted`, and `Updated`. `Rows` is deliberately left intact ([BR-64](../business-rules.md#br-64-clearing-a-grid-resets-only-pending-change-collections)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Controller calls ClearAll])
	Clear["Reset Added, Deleted, Updated to empty lists"]
	EndOk(["Rows preserved, pending collections cleared"])
	Start --> Clear
	Clear --> EndOk
```

## Failure and edge-case behavior

- No unexpected failure paths beyond argument-guard exceptions and delegated dependency behavior were identified for this operation.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.


## Sources
- `src/Web.Mvc/ViewModels/GridRowViewModel.cs`
