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
Copy file name to clipboardExpand all lines: blazor/datagrid/command-column-editing.md
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,10 @@ documentation: ug
9
9
10
10
# Command column editing in Blazor DataGrid
11
11
12
-
The command column editing feature enables CRUD (Create, Read, Update, and Delete) action buttons in a column to perform operations on individual rows. This approach is useful for inline editing, deletion, or saving changes directly within the Grid.
12
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports command column editing, which enables CRUD (Create, Read, Update, Delete) action buttons within a column to perform operations on individual rows. This approach is suitable for inline editing, deletion, or saving changes directly within the Grid.
13
13
14
-
To enable command column editing, use the [GridColumn.Commands](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_Commands) property. This property allows you to define which command buttons—such as Edit, Delete, Save, and Cancel—should appear in the command column.
14
+
To enable command column editing, configure the [GridColumn.Commands](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_Commands) property. This property defines which command buttons**Edit**, **Delete**, **Save**, and **Cancel**should appear in the command column.
15
15
16
-
The available built-in command buttons are:
17
-
18
-
The available built-in command buttons:
19
16
20
17
| Command Button | Action |
21
18
|---------------|-----------------------------|
@@ -24,7 +21,7 @@ The available built-in command buttons:
24
21
| Save | Update the edited row. |
25
22
| Cancel | Cancel the edit operation. |
26
23
27
-
The following example demonstrates how to add CRUD action buttons in a column using the [GridCommandColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridCommandColumns.html) property:
24
+
In this configuration, the [GridCommandColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridCommandColumns.html)property is used to display all four command buttons in the Manage Records column.
28
25
29
26
{% tabs %}
30
27
{% highlight razor tabtitle="Index.razor" %}
@@ -101,12 +98,10 @@ public class OrderDetails
101
98
102
99
## Custom command column
103
100
104
-
The custom command column feature in the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid enables the addition of custom command buttons in a column to perform specific actions on individual rows. This feature is useful for implementing customized functionality such as editing, deleting, or executing other operations on a row.
101
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports adding custom command buttons in a column to perform specific actions on individual rows. This feature is suitable for implementing customized functionality such as editing, deleting, or executing other operations.
105
102
106
103
To add custom command buttons, configure the [GridColumn.Commands](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_Commands) property. Define the actions for these buttons using the [CommandClicked](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEvents-1.html#Syncfusion_Blazor_Grids_GridEvents_1_CommandClicked) event.
107
104
108
-
The following example demonstrates how to add custom command buttons using the [GridCommandColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridCommandColumns.html) property and configure the `CommandClicked` event to display Grid details in a dialog:
109
-
110
105
{% tabs %}
111
106
{% highlight razor tabtitle="Index.razor" %}
112
107
@using Syncfusion.Blazor.Grids
@@ -210,14 +205,16 @@ public class OrderDetails
210
205
211
206
## Hide command column button in specific records
212
207
213
-
In the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid, command columns are used to perform CRUD operations on records, such as editing or deleting. In certain scenarios, command buttons must be hidden for specific records based on defined conditions. This behavior can be achieved using the [RowDataBound](https://blazor.syncfusion.com/documentation/datagrid/events#rowdatabound) event, which is triggered whenever a row is created or updated in the Grid.
208
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports conditionally hiding command buttons for specific records based on defined criteria. This is useful when certain actions such as delete or update should be restricted depending on the record's state.
209
+
210
+
To implement this behavior, use the [RowDataBound](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEvents-1.html#Syncfusion_Blazor_Grids_GridEvents_1_RowDataBound) event, which is triggered whenever a row is created or updated in the Grid.
214
211
215
-
The following steps demonstrate how to conditionally hide command buttons:
212
+
The following steps outline how to conditionally hide command buttons:
216
213
217
-
* Use the `RowDataBound` event of the Grid to access each row's data during rendering.
214
+
* Use the `RowDataBound` event to access each row's data during rendering.
218
215
* Check the value of the **Verified** column for the current record.
219
216
* If the **Verified** value is **false**, display only the **Edit** button; otherwise, display the **Delete** button.
220
-
* To hide buttons, apply a CSS class to the row using the `addClass` method inside the `RowDataBound` event based on the record condition. Define corresponding CSS rules to apply the style to the respective command buttons.
217
+
* To hide buttons, apply a CSS class to the row using the **addClass** method inside the `RowDataBound` event based on the record condition. Define corresponding CSS rules to apply the style to the respective command buttons.
0 commit comments