File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
components/grid/templates Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ Using a `FormTemplate` to modify the Edit/Create Popup window.
4949 OnRead="@OnGridRead"
5050 TItem="@Product"
5151 EditMode="@GridEditMode.Popup"
52+ OnCancel="@OnGridCancel"
5253 OnDelete="@OnGridDelete">
5354 <GridToolBarTemplate>
5455 <GridCommandButton Command="Add">Add Item</GridCommandButton>
@@ -58,7 +59,7 @@ Using a `FormTemplate` to modify the Edit/Create Popup window.
5859 <GridPopupEditFormSettings Context="formContext">
5960 <FormTemplate>
6061 @{
61- if (GridEditItem is null )
62+ if (GridEditItem != formContext.Item )
6263 {
6364 // Setting GridEditItem unconditionally may
6465 // reset the modified and unsaved values after re-render.
@@ -158,6 +159,12 @@ Using a `FormTemplate` to modify the Edit/Create Popup window.
158159 GridEditItem = default;
159160 }
160161
162+ private void OnGridCancel(GridCommandEventArgs args)
163+ {
164+ // Fires when using the Window's Close button.
165+ GridEditItem = default;
166+ }
167+
161168 private async Task OnGridDelete(GridCommandEventArgs args)
162169 {
163170 var deletedItem = (Product)args.Item;
You can’t perform that action at this time.
0 commit comments