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/detail-template.md
+5-19Lines changed: 5 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,9 @@ For an overview of the `detail template` in the grid, watch the following video.
21
21
To integrate the detail template in the grid:
22
22
23
23
1. Add the <DetailTemplate> element within the <GridTemplates> component to define the detail row content.
24
-
2. Use any HTML structure or Blazor components inside the DetailTemplate to render custom content for each expanded row.
24
+
2. Use any HTML structure or Blazor components inside the **DetailTemplate** to render custom content for each expanded row.
25
25
3. Optionally, bind data to the template to display information corresponding to the expanded row.
26
26
27
-
The following example demonstrates using `DetailTemplate` to display additional details for each row:
28
-
29
27
{% tabs %}
30
28
{% highlight razor tabtitle="Index.razor" %}
31
29
@page "/"
@@ -182,8 +180,6 @@ Use the [ExpandCollapseDetailRowAsync](https://help.syncfusion.com/cr/blazor/Syn
182
180
183
181
> Alternatively, call `ExpandCollapseDetailRowAsync` with the row data object in the `DataBound` event.
184
182
185
-
The following example expands the record with `EmployeeID` equal to 1 by invoking `ExpandCollapseDetailRowAsync` in the `DataBound` event:
186
-
187
183
{% tabs %}
188
184
{% highlight razor tabtitle="Index.razor" %}
189
185
@@ -309,7 +305,7 @@ The Syncfusion<sup style="font-size:70%">®</sup> Blazor DataGrid can render
309
305
310
306
To render a custom component or build a hierarchical grid inside the detail row, define the template in the [DetailTemplate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridTemplates.html#Syncfusion_Blazor_Grids_GridTemplates_DetailTemplate) within the `GridTemplates` section. The hierarchical DataGrid displays data in expandable or collapsible levels using the expand or collapse button, or custom content such as HTML elements.
311
307
312
-
The following example uses the detail template to display parent–child data in a hierarchical structure with multiple levels (Employee → Orders → Customers):
308
+
The following example uses the detail template to display parent–child data in a hierarchical structure with multiple levels (**Employee → Orders → Customers**):
313
309
314
310
{% tabs %}
315
311
{% highlight razor tabtitle="Index.razor" %}
@@ -480,8 +476,6 @@ A template column in a detail grid within the Syncfusion<sup style="font-size:70
480
476
481
477
Use the `Template` property of a column to display custom content instead of the field value.
482
478
483
-
The following example shows a custom image in the `Employee Image` column of the detail grid using the column `Template`:
484
-
485
479
{% tabs %}
486
480
{% highlight razor tabtitle="Index.razor" %}
487
481
@@ -841,8 +835,6 @@ public static List<EmployeeData> Employees = new List<EmployeeData>();
841
835
842
836
To expand or collapse a specific detail row programmatically, use [ExpandCollapseDetailRowAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_ExpandCollapseDetailRowAsync__0_) and pass the corresponding row data object.
843
837
844
-
The following example expands or collapses a specific employee’s detail row when the button is clicked.
845
-
846
838
In the example, the `Expand` method validates the row index and then invokes `ExpandCollapseDetailRowAsync` with the selected row’s data:
847
839
848
840
{% tabs %}
@@ -1438,8 +1430,6 @@ Use the [RowDataBound](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.G
1438
1430
1439
1431
```
1440
1432
1441
-
The following example hides the expand/collapse icon for the row with `EmployeeID` equal to `1` when no child records exist:
1442
-
1443
1433
{% tabs %}
1444
1434
{% highlight razor tabtitle="Index.razor" %}
1445
1435
@@ -1577,8 +1567,6 @@ public class OrderData
1577
1567
1578
1568
Aggregates display summary values in the footer, group footer, or group caption of the detail grid. Use this feature to calculate and show summary information.
1579
1569
1580
-
The following example renders aggregates in a detail grid to display the sum and maximum values of the `Freight` column:
1581
-
1582
1570
{% tabs %}
1583
1571
{% highlight razor tabtitle="Index.razor" %}
1584
1572
@@ -2082,7 +2070,7 @@ To customize the appearance of the group expand/collapse icons in the detail Gri
2082
2070
}
2083
2071
```
2084
2072
2085
-
In this example, the `.e-icon-gdownarrow` and `.e-icon-grightarrow` classes target the expand and collapse icons, respectively. Modify the `content` property to change the icon displayed. You can use the available [Syncfusion<supstyle="font-size:70%">®</sup> icons](https://blazor.syncfusion.com/documentation/appearance/icons) based on your theme.
2073
+
In this example, the `.e-icon-gdownarrow` and `.e-icon-grightarrow` classes target the expand and collapse icons, respectively. Modify the `content` property to change the icon displayed. [Syncfusion<supstyle="font-size:70%">®</sup> icons](https://blazor.syncfusion.com/documentation/appearance/icons)sets can be used based on the selected theme.
2086
2074
2087
2075

2088
2076
@@ -2282,13 +2270,11 @@ In this example, the `.e-cellselectionbackground` class targets the background c
2282
2270
2283
2271
Detail template is not supported with the following features:
Copy file name to clipboardExpand all lines: blazor/datagrid/row-drag-and-drop.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,7 @@ Enable row drag and drop by setting [AllowRowDragAndDrop](https://help.syncfusio
18
18
19
19
## Drag and drop within DataGrid
20
20
21
-
The drag and drop feature enables reordering of rows within the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid using the drag handle. Set the [AllowRowDragAndDrop](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_AllowRowDragAndDrop) property to `true` to enable this feature. By default, the value is `false`.
22
-
23
-
Here is an example that enables row drag and drop within the grid:
21
+
The drag and drop feature enables reordering of rows within the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid using the drag handle. Set the [AllowRowDragAndDrop](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_AllowRowDragAndDrop) property to **true** to enable this feature. By default, the value is **false**.
24
22
25
23
{% tabs %}
26
24
{% highlight razor tabtitle="Index.razor" %}
@@ -106,9 +104,7 @@ Here is an example that enables row drag and drop within the grid:
106
104
## Drag and drop to DataGrid
107
105
108
106
109
-
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports dragging rows from one grid and dropping them into another. Enable this feature by setting the [AllowRowDragAndDrop](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_AllowRowDragAndDrop) property to `true` on both grids. To specify the target grid, configure the [RowDropSettings.TargetID](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridRowDropSettings.html#Syncfusion_Blazor_Grids_GridRowDropSettings_TargetID) property with the target grid's ID.
110
-
111
-
The following example enables row drag and drop between two grids:
107
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports dragging rows from one grid and dropping them into another. Enable this feature by setting the [AllowRowDragAndDrop](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_AllowRowDragAndDrop) property to **true** on both grids. To specify the target grid, configure the [RowDropSettings.TargetID](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridRowDropSettings.html#Syncfusion_Blazor_Grids_GridRowDropSettings_TargetID) property with the target grid's ID.
112
108
113
109
{% tabs %}
114
110
{% highlight razor tabtitle="Index.razor" %}
@@ -287,7 +283,7 @@ public class OrdersDetails
287
283
288
284
## Drag and drop to custom component
289
285
290
-
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports dragging rows into custom components. Enable [AllowRowDragAndDrop] and set [RowDropSettings.TargetID](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridRowDropSettings.html#Syncfusion_Blazor_Grids_GridRowDropSettings_TargetID) to the `ID` of the target component.
286
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports dragging rows into custom components. Enable [AllowRowDragAndDrop] and set [RowDropSettings.TargetID](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridRowDropSettings.html#Syncfusion_Blazor_Grids_GridRowDropSettings_TargetID) to the **ID** of the target component.
291
287
292
288
In the following example, selected grid rows are dropped into a TreeGrid using the [RowDropped](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEvents-1.html#Syncfusion_Blazor_Grids_GridEvents_1_RowDropped) event. After the drop, the corresponding rows are removed from the source grid and added to the target:
293
289
@@ -795,4 +791,4 @@ public class OrderData
795
791
- A single row can be dragged and dropped within the same grid even if multiple selection is not enabled.
796
792
- Row drag and drop does not have built-in support when combined with sorting, filtering, hierarchy grid, or row template features.
797
793
- Row drag and drop with grouping does not support lazy-load grouping.
798
-
-Drag and drop within the same group key is not supported. Dragging multiple rows from different grouped collections is not supported.
794
+
-Dragging and dropping within the same group key is not supported. The grid does not allow drag-and-drop for multiple rows that belong to different grouped collections.
The following example demonstrates a row template that displays employee information with a photo in the first column and details such as name, address, and other fields in the second column for each row.
25
-
26
24
{% tabs %}
27
25
{% highlight razor tabtitle="Index.razor" %}
28
26
@@ -197,8 +195,6 @@ Typically, the Syncfusion<sup style="font-size:70%">®</sup> Blazor DataGrid
197
195
198
196
To format values inside a row template, apply .NET formatting in the template (for example, using `ToString` with a format string) or invoke a helper method to produce the desired output such as dates, currency, or custom text.
199
197
200
-
The following example formats the hire date within the template using a custom date format:
201
-
202
198
{% tabs %}
203
199
{% highlight razor tabtitle="Index.razor" %}
204
200
@@ -518,8 +514,6 @@ The Syncfusion<sup style="font-size:70%">®</sup> Blazor DataGrid supports em
518
514
519
515
To render a Syncfusion<supstyle="font-size:70%">®</sup> Blazor Chart in a row template, use the [RowTemplate](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridTemplates.html#Syncfusion_Blazor_Grids_GridTemplates_RowTemplate) property to define the row layout and include the chart markup within the template.
520
516
521
-
The following example renders a Syncfusion<supstyle="font-size:70%">®</sup> chart alongside order details in each row:
Copy file name to clipboardExpand all lines: blazor/datagrid/row.md
+4-20Lines changed: 4 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,9 +227,6 @@ To change the background color of the selected row, add the following CSS:
227
227
background-color: #f9920b;
228
228
}
229
229
```
230
-
231
-
The following example uses the `.e-selectionbackground` class to style the selected row:
232
-
233
230
{% tabs %}
234
231
{% highlight razor tabtitle="Index.razor" %}
235
232
@@ -317,8 +314,6 @@ public class OrderData
317
314
318
315
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid supports customizing row height to display more or less content as needed. Use the [RowHeight](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_RowHeight) property to change the height of all rows in the Grid.
319
316
320
-
The following example demonstrates dynamically changing the row height using the `RowHeight` property:
321
-
322
317
{% tabs %}
323
318
{% highlight razor tabtitle="Index.razor" %}
324
319
@@ -425,8 +420,6 @@ public class OrderData
425
420
426
421
Customize the row height for a specific row when a single record needs additional space or emphasis. Use the [RowHeight](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_RowHeight) property in combination with the [RowDataBound](https://blazor.syncfusion.com/documentation/datagrid/events#rowdatabound) event to apply a CSS class conditionally.
427
422
428
-
In the following example, the row with `OrderID` '10249' is assigned a custom height via a CSS class in the `RowDataBound` event:
429
-
430
423
{% tabs %}
431
424
{% highlight razor tabtitle="Index.razor" %}
432
425
@@ -524,9 +517,7 @@ public class OrderData
524
517
525
518
The row hover feature applies a visual effect when the mouse pointer is over a row, improving readability and helping to identify the focused record. Enable or disable the effect using the [EnableHover](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableHover) property.
526
519
527
-
By default, `EnableHover` is `true`. Set it to `false` to disable row hover.
528
-
529
-
The following example enables or disables row hover using a [Switch](https://blazor.syncfusion.com/documentation/toggle-switch-button/getting-started-webapp) component:
520
+
By default, `EnableHover` is **true**. Set it to **false** to disable row hover.
530
521
531
522
{% tabs %}
532
523
{% highlight razor tabtitle="Index.razor" %}
@@ -617,9 +608,7 @@ The following example enables or disables row hover using a [Switch](https://bla
617
608
618
609
## Row pinning (Frozen)
619
610
620
-
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid can freeze rows to keep them visible while scrolling vertically through large datasets. This maintains important context as users navigate data.
621
-
622
-
To know about frozen rows in Grid, you can check this video.
611
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid provides an option to freeze rows, keeping them visible while scrolling vertically through large datasets. This feature helps maintain important information in view for better readability.
>The **data** object representing the new row to be added
855
-
>The **index** at which the new row should be inserted. If no index is specified, the new row is added at the end.
841
+
- The **data** object representing the new row to be added
842
+
- The **index** at which the new row should be inserted. If no index is specified, the new row is added at the end.
856
843
857
-
The following example shows how to add a new row using `AddRecordAsync`:
858
844
859
845
{% tabs %}
860
846
{% highlight razor tabtitle="Index.razor" %}
@@ -1032,8 +1018,6 @@ The Syncfusion<sup style="font-size:70%">®</sup> Blazor DataGrid can display
1032
1018
1033
1019
Usethe [RowSelected](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridEvents-1.html#Syncfusion_Blazor_Grids_GridEvents_1_RowSelected) event on the master Grid to obtain the selected record. Apply a filter through the [Query](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Query) property of the detail Grid and bind the resulting collection to its [DataSource](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_DataSource).
0 commit comments