Skip to content

Commit a499429

Browse files
984957: Updated the UG content and samples for Row in Blazor DataGrid
1 parent 57704f9 commit a499429

File tree

4 files changed

+13
-53
lines changed

4 files changed

+13
-53
lines changed

blazor/datagrid/detail-template.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ For an overview of the `detail template` in the grid, watch the following video.
2121
To integrate the detail template in the grid:
2222

2323
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.
2525
3. Optionally, bind data to the template to display information corresponding to the expanded row.
2626

27-
The following example demonstrates using `DetailTemplate` to display additional details for each row:
28-
2927
{% tabs %}
3028
{% highlight razor tabtitle="Index.razor" %}
3129
@page "/"
@@ -182,8 +180,6 @@ Use the [ExpandCollapseDetailRowAsync](https://help.syncfusion.com/cr/blazor/Syn
182180

183181
> Alternatively, call `ExpandCollapseDetailRowAsync` with the row data object in the `DataBound` event.
184182
185-
The following example expands the record with `EmployeeID` equal to 1 by invoking `ExpandCollapseDetailRowAsync` in the `DataBound` event:
186-
187183
{% tabs %}
188184
{% highlight razor tabtitle="Index.razor" %}
189185

@@ -309,7 +305,7 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid can render
309305

310306
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.
311307

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**):
313309

314310
{% tabs %}
315311
{% highlight razor tabtitle="Index.razor" %}
@@ -480,8 +476,6 @@ A template column in a detail grid within the Syncfusion<sup style="font-size:70
480476

481477
Use the `Template` property of a column to display custom content instead of the field value.
482478

483-
The following example shows a custom image in the `Employee Image` column of the detail grid using the column `Template`:
484-
485479
{% tabs %}
486480
{% highlight razor tabtitle="Index.razor" %}
487481

@@ -841,8 +835,6 @@ public static List<EmployeeData> Employees = new List<EmployeeData>();
841835

842836
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.
843837

844-
The following example expands or collapses a specific employee’s detail row when the button is clicked.
845-
846838
In the example, the `Expand` method validates the row index and then invokes `ExpandCollapseDetailRowAsync` with the selected row’s data:
847839

848840
{% tabs %}
@@ -1438,8 +1430,6 @@ Use the [RowDataBound](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.G
14381430

14391431
```
14401432

1441-
The following example hides the expand/collapse icon for the row with `EmployeeID` equal to `1` when no child records exist:
1442-
14431433
{% tabs %}
14441434
{% highlight razor tabtitle="Index.razor" %}
14451435

@@ -1577,8 +1567,6 @@ public class OrderData
15771567

15781568
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.
15791569

1580-
The following example renders aggregates in a detail grid to display the sum and maximum values of the `Freight` column:
1581-
15821570
{% tabs %}
15831571
{% highlight razor tabtitle="Index.razor" %}
15841572

@@ -2082,7 +2070,7 @@ To customize the appearance of the group expand/collapse icons in the detail Gri
20822070
}
20832071
```
20842072

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<sup style="font-size:70%">&reg;</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<sup style="font-size:70%">&reg;</sup> icons](https://blazor.syncfusion.com/documentation/appearance/icons) sets can be used based on the selected theme.
20862074

20872075
![Detail Grid group expand or collapse icons in Blazor](images/hierarchy-grid/grid-child-group-expand-or-collapse-icons.png)
20882076

@@ -2282,13 +2270,11 @@ In this example, the `.e-cellselectionbackground` class targets the background c
22822270

22832271
Detail template is not supported with the following features:
22842272

2285-
* Frozen rows and columns
22862273
* Immutable mode
22872274
* Infinite scrolling
22882275
* Virtual scrolling
22892276
* Print
22902277
* Row template
2291-
* Row spanning
2292-
* Column spanning
22932278
* Lazy load grouping
2294-
* State persistence
2279+
* State persistence
2280+
* Row and Column Spanning

blazor/datagrid/row-drag-and-drop.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ Enable row drag and drop by setting [AllowRowDragAndDrop](https://help.syncfusio
1818
1919
## Drag and drop within DataGrid
2020

21-
The drag and drop feature enables reordering of rows within the Syncfusion<sup style="font-size:70%">&reg;</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<sup style="font-size:70%">&reg;</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**.
2422

2523
{% tabs %}
2624
{% highlight razor tabtitle="Index.razor" %}
@@ -106,9 +104,7 @@ Here is an example that enables row drag and drop within the grid:
106104
## Drag and drop to DataGrid
107105

108106

109-
The Syncfusion<sup style="font-size:70%">&reg;</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<sup style="font-size:70%">&reg;</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.
112108

113109
{% tabs %}
114110
{% highlight razor tabtitle="Index.razor" %}
@@ -287,7 +283,7 @@ public class OrdersDetails
287283

288284
## Drag and drop to custom component
289285

290-
The Syncfusion<sup style="font-size:70%">&reg;</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<sup style="font-size:70%">&reg;</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.
291287

292288
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:
293289

@@ -795,4 +791,4 @@ public class OrderData
795791
- A single row can be dragged and dropped within the same grid even if multiple selection is not enabled.
796792
- Row drag and drop does not have built-in support when combined with sorting, filtering, hierarchy grid, or row template features.
797793
- 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.

blazor/datagrid/row-template.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ For an overview of `row templates` in the Grid, watch the following video.
2121

2222
{% youtube "youtube:https://www.youtube.com/watch?v=Dft0kerEGUQ" %}
2323

24-
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-
2624
{% tabs %}
2725
{% highlight razor tabtitle="Index.razor" %}
2826

@@ -197,8 +195,6 @@ Typically, the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid
197195

198196
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.
199197

200-
The following example formats the hire date within the template using a custom date format:
201-
202198
{% tabs %}
203199
{% highlight razor tabtitle="Index.razor" %}
204200

@@ -518,8 +514,6 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports em
518514

519515
To render a Syncfusion<sup style="font-size:70%">&reg;</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.
520516

521-
The following example renders a Syncfusion<sup style="font-size:70%">&reg;</sup> chart alongside order details in each row:
522-
523517
{% tabs %}
524518
{% highlight razor tabtitle="Index.razor" %}
525519
@page "/"

blazor/datagrid/row.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,6 @@ To change the background color of the selected row, add the following CSS:
227227
background-color: #f9920b;
228228
}
229229
```
230-
231-
The following example uses the `.e-selectionbackground` class to style the selected row:
232-
233230
{% tabs %}
234231
{% highlight razor tabtitle="Index.razor" %}
235232

@@ -317,8 +314,6 @@ public class OrderData
317314

318315
The Syncfusion<sup style="font-size:70%">&reg;</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.
319316

320-
The following example demonstrates dynamically changing the row height using the `RowHeight` property:
321-
322317
{% tabs %}
323318
{% highlight razor tabtitle="Index.razor" %}
324319

@@ -425,8 +420,6 @@ public class OrderData
425420

426421
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.
427422

428-
In the following example, the row with `OrderID` '10249' is assigned a custom height via a CSS class in the `RowDataBound` event:
429-
430423
{% tabs %}
431424
{% highlight razor tabtitle="Index.razor" %}
432425

@@ -524,9 +517,7 @@ public class OrderData
524517

525518
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.
526519

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.
530521

531522
{% tabs %}
532523
{% highlight razor tabtitle="Index.razor" %}
@@ -617,9 +608,7 @@ The following example enables or disables row hover using a [Switch](https://bla
617608
618609
## Row pinning (Frozen)
619610

620-
The Syncfusion<sup style="font-size:70%">&reg;</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<sup style="font-size:70%">&reg;</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.
623612

624613
{% youtube "youtube:https://www.youtube.com/watch?v=L2NvKyBomhM"%}
625614

@@ -746,8 +735,6 @@ Apply the following CSS to change the default line color:
746735
}
747736
```
748737

749-
The following example demonstrates changing the frozen rows’ line color using CSS:
750-
751738
{% tabs %}
752739
{% highlight razor tabtitle="Index.razor" %}
753740

@@ -851,10 +838,9 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports pr
851838

852839
The `AddRecordAsync` method takes two parameters:
853840

854-
> 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.
856843

857-
The following example shows how to add a new row using `AddRecordAsync`:
858844

859845
{% tabs %}
860846
{% highlight razor tabtitle="Index.razor" %}
@@ -1032,8 +1018,6 @@ The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid can display
10321018

10331019
Use the [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).
10341020
1035-
In the following sample, selecting a row in the master Grid displays the corresponding orders in the detail Grid:
1036-
10371021
{% tabs %}
10381022
{% highlight razor tabtitle="Index.razor" %}
10391023

0 commit comments

Comments
 (0)