You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<td>Grid for Blazor <br/> TreeList for Blazor <br/> Scheduler for Blazor </td>
19
-
</tr>
20
-
</tbody>
16
+
<tbody>
17
+
<tr>
18
+
<td>Product</td>
19
+
<td>Grid for Blazor <br/> TreeList for Blazor <br/> Scheduler for Blazor </td>
20
+
</tr>
21
+
</tbody>
21
22
</table>
22
23
23
24
@@ -63,70 +64,120 @@ The keys for the elements of the built-in Delete Confirmation Dialog are:
63
64
64
65
Use [Predefined Confirm Dialog]({%slug dialog-predefined%}#confirm) with the desired custom text. Additionally, you may get the details for the current item and add them to the text:
65
66
66
-
* Handle the [`OnDelete`]({%slug grid-events%}#cud-events) event of the Grid
67
-
* Display the Predefined Dialog in the `OnDelete` handler
68
-
* Cancel the event or proceed with the `OnDelete` logic depending on the user choice
67
+
* Use the Grid `Class` parameter to set a `z-index` style, which is lower than the default Dialog `z-index` of 10,000.
68
+
* Handle the [`OnDelete`]({%slug grid-events%}#cud-events) event of the Grid.
69
+
* Display the predefined Dialog in the `OnDelete` handler.
70
+
* Cancel the event or proceed with the `OnDelete` logic depending on the user choice.
71
+
* The same approach is applicable for the `OnCreate` and `OnUpdate` events.
dialogResult = await TelerikDialogs.ConfirmAsync(dialogMessage, "Confirm Data Change");
155
+
}
156
+
157
+
return !dialogResult;
158
+
}
159
+
160
+
protected override void OnInitialized()
161
+
{
162
+
for (int i = 1; i <= 30; i++)
163
+
{
164
+
GridData.Add(new Product()
165
+
{
166
+
Id = ++LastId,
167
+
Name = $"Name {LastId}",
168
+
Price = Random.Shared.Next(1, 100) * 1.23m,
169
+
Quantity = Random.Shared.Next(0, 1000),
170
+
});
171
+
}
172
+
}
173
+
174
+
public class Product
175
+
{
176
+
public int Id { get; set; }
177
+
[Required]
178
+
public string Name { get; set; } = "Default Name";
179
+
public decimal Price { get; set; }
180
+
public int Quantity { get; set; }
130
181
}
131
182
}
132
183
````
@@ -136,94 +187,154 @@ Use [Predefined Confirm Dialog]({%slug dialog-predefined%}#confirm) with the des
136
187
Using the [Dialog component]({%slug dialog-overview%}) will let you have fully customized Delete Confirmation Dialog. To handle the scenario:
137
188
138
189
* Declare a Dialog instance and add the desired content and buttons there. Normally, you would need at least two buttons - for confirmation and cancelling the delete operation.
139
-
*Handle the [`OnDelete`]({%slug grid-events%}#cud-events) event of the Grid to cancel the built-in delete, show the custom Dialog and get the current item (save the current item, so you can then use its details in the dialog if needed).
190
+
*Use [custom commands]({%slug components/grid/columns/command%}) instead of the built-in `Save`and `Delete` commands to obtain the data item and show the Dialog component.
140
191
* Handle the Dialog button clicks:
141
-
* Proceed with the item deletion in the Confirm button click handler.
142
-
* Hide the Dialog on Cancel.
192
+
* Proceed with the item deletion in the Confirm button click handler.
193
+
* Hide the Dialog on Cancel. Optionally, [exit Grid edit mode programmatically]({%slug grid-kb-add-edit-state%}).
194
+
* The same approach is applicable for the `OnCreate` and `OnUpdate` events.
0 commit comments