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/infinite-scrolling.md
+3-9Lines changed: 3 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,11 @@ documentation: ug
11
11
12
12
The infinite scrolling feature in the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid provides load-on-demand data retrieval to handle large datasets without degrading performance. In default infinite scrolling, the Grid fetches the next block of data when the vertical scrollbar reaches the end of the scroller, creating a seamless browsing experience across extensive data.
13
13
14
-
In this feature, a block is equivalent to the Grid’s [PageSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridPageSettings.html#Syncfusion_Blazor_Grids_GridPageSettings_PageSize). If `PageSize` is not set, the Grid calculates it from the viewport height and row height. To enable infinite scrolling, set [EnableInfiniteScrolling](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableInfiniteScrolling) to true and define a content [Height](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Height).
14
+
In this feature, a block is equivalent to the Grid’s [PageSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridPageSettings.html#Syncfusion_Blazor_Grids_GridPageSettings_PageSize). If `PageSize` is not set, the Grid calculates it from the viewport height and row height. To enable infinite scrolling, set [EnableInfiniteScrolling](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableInfiniteScrolling) to **true** and define a content [Height](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Height).
15
15
16
16
> - With this feature, the Grid does not issue a new data request when revisiting a previously loaded page.
17
17
> - The `Height` property must be specified when `EnableInfiniteScrolling` is enabled (a fixed container height is required).
18
18
19
-
The following is an example that demonstrates how to enable infinite scroll in the Grid:
20
-
21
19
{% tabs %}
22
20
{% highlight razor tabtitle="Index.razor" %}
23
21
@@ -88,8 +86,6 @@ At initial load, the Grid renders a specified number of data blocks (pages), whi
88
86
89
87
Configure this using [InitialBlocks](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridInfiniteScrollSettings.html) on [GridInfiniteScrollSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridInfiniteScrollSettings.html). By default, three pages are rendered initially. Afterwards, additional data is buffered and loaded based on page size or the number of rows that fit within the given height.
90
88
91
-
The following example shows how to set the `initial blocks `based on a `DropDownList` selection:
92
-
93
89
{% tabs %}
94
90
{% highlight razor tabtitle="Index.razor" %}
95
91
@@ -189,11 +185,9 @@ public class TaskDetails
189
185
190
186
In Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid cache mode, previously loaded blocks are reused when revisited, reducing repeat data requests. The Grid manages the number of rendered DOM row elements using [GridInfiniteScrollSettings.MaximumBlocks](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridInfiniteScrollSettings.html#Syncfusion_Blazor_Grids_GridInfiniteScrollSettings_MaximumBlocks). When this limit is reached, the Grid removes an older block of row elements to render new ones.
191
187
192
-
Enable cache mode by setting [EnableCache](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridInfiniteScrollSettings.html#Syncfusion_Blazor_Grids_GridInfiniteScrollSettings_EnableCache) to true on [GridInfiniteScrollSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridInfiniteScrollSettings.html).
193
-
194
-
Configure the maximum cached blocks with `MaximumBlocks` (default: 3).
188
+
Enable cache mode by setting [EnableCache](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridInfiniteScrollSettings.html#Syncfusion_Blazor_Grids_GridInfiniteScrollSettings_EnableCache) to **true** on [GridInfiniteScrollSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridInfiniteScrollSettings.html).
195
189
196
-
The following example toggles cache mode using a Switch component and updates the Grid accordingly:
190
+
Configure the maximum cached blocks with `MaximumBlocks` (**default: 3**).
Copy file name to clipboardExpand all lines: blazor/datagrid/scrolling.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ documentation: ug
9
9
10
10
# Scrolling in Blazor DataGrid
11
11
12
-
The scrolling feature in the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid enables navigation through content that extends beyond the visible area of the Grid. Scrollbars appear automatically when content exceeds the specified `Width` or `Height` of the Grid element. This is useful for large datasets or when the Grid must fit within a constrained layout. The vertical and horizontal scrollbars are displayed based on the following criteria:
12
+
The scrolling feature in the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid enables navigation through content that extends beyond the visible area of the Grid. Scrollbars appear automatically when content exceeds the specified **Width** or **Height** of the Grid element. This is useful for large datasets or when the Grid must fit within a constrained layout. The vertical and horizontal scrollbars are displayed based on the following criteria:
13
13
14
14
* The vertical scrollbar appears when the total height of rows exceeds the Grid element’s height.
15
15
* The horizontal scrollbar appears when the total width of columns exceeds the Grid element’s width.
16
16
* The [Height](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Height) and [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Width) properties define the Grid’s height and width.
17
17
18
-
> The default values for `Height` and `Width` are `auto`.
18
+
> The default values for `Height` and `Width` are **auto**.
19
19
20
20
## Set width and height
21
21
@@ -103,8 +103,6 @@ The Syncfusion<sup style="font-size:70%">®</sup> Blazor DataGrid can fill it
103
103
104
104
To enable this, set the Grid’s [Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Width) and [Height](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Height) to 100%. The Grid’s parent element must have an explicit height; otherwise, a vertical scrollbar will not appear.
105
105
106
-
In the following example, the parent container has explicit height and width, and the Grid container is set to 100% for both dimensions to size responsively with its parent:
Copy file name to clipboardExpand all lines: blazor/datagrid/virtual-scrolling.md
+7-26Lines changed: 7 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,13 @@ documentation: ug
11
11
12
12
The virtual scrolling feature in the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid efficiently handles large datasets by rendering only the rows currently visible in the viewport instead of the entire data source. This reduces DOM size, improves responsiveness, and lowers initial load time for datasets with thousands of records.
13
13
14
-
To learn about `virtualization` in the Grid, watch the following video:
Row virtualization is a technique that optimizes rendering performance for large datasets in data grids. Instead of loading all rows at once, it dynamically loads and renders only the rows visible within the viewport during vertical scrolling. This approach reduces the initial load time and memory usage, making it a more efficient alternative to traditional paging.
21
19
22
-
To configure row virtualization, set [EnableVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualization) to `true` and define a fixed content height using the [Height](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Height) property. The number of rendered records is implicitly determined by the content height. Optionally, you can influence the visible count using [GridPageSettings.PageSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridPageSettings.html#Syncfusion_Blazor_Grids_GridPageSettings_PageSize). Data is cached and reused while scrolling.
23
-
24
-
The following example enables row virtualization using the `EnableVirtualization` property.
20
+
To configure row virtualization, set [EnableVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualization) to **true** and define a fixed content height using the [Height](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Height) property. The number of rendered records is implicitly determined by the content height. The visible count can be adjusted using [GridPageSettings.PageSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridPageSettings.html#Syncfusion_Blazor_Grids_GridPageSettings_PageSize) data is cached and reused while scrolling.
25
21
26
22
{% tabs %}
27
23
{% highlight razor tabtitle="Index.razor" %}
@@ -91,8 +87,6 @@ public class TaskDetails
91
87
92
88
The [OverscanCount](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_OverscanCount) property in the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid improves perceived scrolling performance by pre-rendering a buffer of rows before and after the visible viewport. This reduces the frequency of data fetches and DOM updates for smoother scrolling, and applies during both initial rendering and virtual scrolling.
93
89
94
-
The following example set `OverscanCount` to `5`, which preloaded five additional rows before and after the viewport.
95
-
96
90
{% tabs %}
97
91
{% highlight razor tabtitle="Index.razor" %}
98
92
@@ -184,11 +178,11 @@ public class OrderDetails
184
178
2. Detail template
185
179
3. Row template
186
180
4. Autofill
187
-
5. Hierarchy Grid
181
+
188
182
* With row virtual scrolling, copy-paste and drag-and-drop apply only to items within the current viewport.
189
183
* Cell-based selection is not supported for row virtual scrolling.
190
184
* Variable row heights in template columns—where each row has a different height—are not supported.
191
-
*Group expand/collapse state is not persisted.
185
+
*By default, the group expand/collapse state is not persisted. To persist the state, set the [GridGroupSettings.PersistGroupState](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridGroupSettings.html#Syncfusion_Blazor_Grids_GridGroupSettings_PersistGroupState) property to **true**. For more details, refer to the [documentation](https://blazor.syncfusion.com/documentation/datagrid/grouping#persist-grouped-row-expand-or-collapse-state).
192
186
* Due to browser element height limits, the maximum number of records is bounded by browser capabilities.
193
187
* Grid content height is calculated from row height and total record count; features that change row height (such as text wrapping) are not supported.
194
188
* To increase row height while keeping all rows uniform, specify a fixed height:
@@ -207,9 +201,7 @@ public class OrderDetails
207
201
208
202
Column virtualization in Syncfusion<sup style="font-size:70%">®</sup> Blazor DataGrid improves performance when many columns are present by rendering only the columns visible in the viewport. As the user scrolls horizontally, additional columns are loaded dynamically. This reduces initial render time and memory usage.
209
203
210
-
Enable it by setting [EnableColumnVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableColumnVirtualization) to `true`. For predictable behavior, assign explicit widths to columns (see [GridColumn.Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_Width)).
211
-
212
-
The following example enables column virtualization using the `EnableColumnVirtualization` property.
204
+
Enable it by setting [EnableColumnVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableColumnVirtualization) to **true**. For predictable behavior, assign explicit widths to columns (see [GridColumn.Width](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_Width)).
213
205
214
206
{% tabs %}
215
207
{% highlightrazortabtitle="Index.razor" %}
@@ -402,8 +394,6 @@ Column virtualization in Syncfusion<sup style="font-size:70%">®</sup> Blazor
402
394
403
395
Enabling both features together significantly improves the responsiveness and scalability of the Grid, even when working with thousands of rows and hundreds of columns.
404
396
405
-
The following example demonstrates both features enabled:
406
-
407
397
{% tabs %}
408
398
{% highlightrazortabtitle="Index.razor" %}
409
399
@@ -497,8 +487,6 @@ To configure this setup, set the following properties to true:
The Syncfusion<sup style="font-size:70%">®</sup> BlazorDataGridoffersanoptiontodisplaycellplaceholderswhilenewdataisbeingloadedduringroworcolumnvirtualization. Thisfeatureimprovesuserexperiencebyshowingavisualindicator (loadingplaceholder) ingridcellswhiledataisbeingfetched. Itisespeciallybeneficialwhenworkingwithlargedatasetsorwhenvirtualizationisusedtoloaddatadynamicallyasscrollingoccurs.
612
599
613
-
Set [EnableVirtualMaskRow](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualMaskRow) to`true`toreuseDOMelementsandshowplaceholdersuntiltheincomingdataisrendered.
600
+
Set [EnableVirtualMaskRow](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualMaskRow) to**true**toreuseDOMelementsandshowplaceholdersuntiltheincomingdataisrendered.
@@ -717,8 +702,6 @@ To enable frozen columns with virtualization:
717
702
718
703
**EnableVirtualization:** Turn on both [EnableVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualization) and [EnableColumnVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableColumnVirtualization).
@@ -908,8 +891,6 @@ To ensure smooth scrolling behavior, virtualization must be enabled in the Grid.
908
891
* **Horizontalscrolling:** enable both [EnableVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualization) and [EnableColumnVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableColumnVirtualization).
The [UpdatePageSizeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_UpdatePageSizeAsync_System_Int32_System_Int32_) methodintheSyncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid refreshes the virtualized Grid’s PageSize externally by using the specified Grid height or container height along with the row height. This method calculates the `PageSize` programmatically and updates the Grid with the new value.
1015
996
1016
-
To enable external refresh of the virtualized Grid, set [EnableVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualization) to`true`.
997
+
To enable external refresh of the virtualized Grid, set [EnableVirtualization](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableVirtualization) to**true**.
0 commit comments