Skip to content

Commit 274fd12

Browse files
992126: Updated the UG content and samples for Columns in Blazor DataGrid
1 parent 4e7934c commit 274fd12

File tree

1 file changed

+45
-27
lines changed

1 file changed

+45
-27
lines changed

blazor/datagrid/frozen-column.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,35 @@ documentation: ug
99

1010
# Column Pinning (Frozen) in Blazor DataGrid
1111

12-
In the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid, you have the capability to **freeze** columns, ensuring they remain visible as you scroll through extensive datasets. This functionality significantly improves user experience by keeping critical information constantly within view, even when navigating through large volumes of data. This means that important columns remain fixed in their positions, making it easier to access and reference key data points while working with the Grid.
12+
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports freezing columns to keep them visible while scrolling through large datasets. This feature ensures that important fields remain accessible regardless of horizontal scroll position.
1313

14-
To know about frozen columns in Grid, you can check this video.
14+
Column pinning can be configured using either grid-level or column-level settings.
15+
16+
**Grid-level freezing**
17+
18+
To freeze columns from the left side of the grid:
19+
20+
- Set the [FrozenColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenColumns) property in the [SfGrid](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html) component to a **numeric** value.
21+
- This value determines how many columns from the **left** remain **fixed** during horizontal scrolling.
22+
23+
**Column-level freezing**
24+
25+
To freeze specific columns regardless of their position:
26+
27+
- Set the [IsFrozen](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsFrozen) property of a [GridColumn](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html) to **true**.
28+
- Use the [Freeze](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_Freeze) property to define the freeze direction. The [FreezeDirection](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.FreezeDirection.html) enum supports the following values:
29+
30+
* [Left](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.FreezeDirection.html#Syncfusion_Blazor_Grids_FreezeDirection_Left) – Freezes the column to the left side of the grid.
31+
* [Right](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.FreezeDirection.html#Syncfusion_Blazor_Grids_FreezeDirection_Right) – Freezes the column to the right side of the grid.
32+
* [Fixed](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.FreezeDirection.html#Syncfusion_Blazor_Grids_FreezeDirection_Fixed) – Keeps the column fixed in place regardless of scroll direction.
33+
34+
These options allow precise control over which columns remain visible during horizontal scrolling.
35+
36+
A video demonstration is available at:
1537

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

18-
In the following example, the [FrozenColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenColumns) property is set to **2**. This configuration freezes the left two columns of the Grid, and they will remain fixed in their positions while the rest of the columns Grid can be scrolled horizontally:
40+
In this configuration, the `FrozenColumns` property is set to **2**, which keeps the first two columns fixed while the remaining columns can be scrolled horizontally.
1941

2042
{% tabs %}
2143
{% highlight razor tabtitle="Index.razor" %}
@@ -130,32 +152,32 @@ public class OrderDetails
130152

131153
{% previewsample "https://blazorplayground.syncfusion.com/embed/BDhfWsCbfiSSvvZz?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
132154

133-
> * Frozen columns should not be set outside the Grid view port.
134-
> * Frozen Grid support column virtualization feature, which helps to improve the Grid performance while loading a large dataset.
135-
> * The frozen feature is supported only for the columns that are visible in the current view.
136-
> * You can use both `FrozenColumns` property and [FrozenRows](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenRows) property in the same application.
155+
> * Frozen columns must remain within the visible viewport of the grid.
156+
> * Column virtualization is supported with frozen columns to improve performance when handling large datasets.
157+
> * Freezing is applicable only to columns currently visible in the grid.
158+
> * Both [FrozenColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenColumns) and [FrozenRows](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenRows) properties can be used together in the same grid.
137159
138160
## Change default frozen line color
139161

140-
You can customize the frozen line borders of frozen columns in the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid by applying custom CSS styles to the specific frozen column. This allows you to change the border color of the left frozen columns, right frozen columns, and fixed frozen columns to match your application's design and theme.
162+
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid allows customizing the border color of frozen columns using CSS. This includes styling for **left**, **right**, and **fixed** frozen columns to match application design requirements.
141163

142-
To change default frozen line color, use the following class name and apply the border color based on your requirement.
164+
To change the default frozen line color, apply styles using these class selectors:
143165

144-
For left frozen columns:
166+
* **Left frozen columns**
145167

146168
```css
147169
.e-grid .e-leftfreeze.e-freezeleftborder {
148170
border-right-color: rgb(198, 30, 204);
149171
}
150172
```
151-
For right frozen columns:
173+
* **Right frozen columns**
152174

153175
```css
154176
.e-grid .e-rightfreeze.e-freezerightborder {
155177
border-left-color: rgb(19, 228, 243);
156178
}
157179
```
158-
For fixed frozen columns, you need to specify both left and right border as mentioned below
180+
* **Fixed frozen columns**
159181

160182
```css
161183
.e-grid .e-fixedfreeze.e-freezeleftborder{
@@ -166,7 +188,6 @@ For fixed frozen columns, you need to specify both left and right border as ment
166188
border-right-color: rgb(10, 224, 10);
167189
}
168190
```
169-
The following example demonstrates how to change the default frozen line color using CSS:
170191

171192
{% tabs %}
172193
{% highlight razor tabtitle="Index.razor" %}
@@ -274,9 +295,7 @@ The following example demonstrates how to change the default frozen line color u
274295

275296
## Detail template with frozen columns
276297

277-
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid allows columns to be **frozen** while using a [detail template](https://blazor.syncfusion.com/documentation/datagrid/detail-template). The detail template in the Grid enables you to display additional information about a specific row by expanding or collapsing its detail content.
278-
279-
Here’s an example of using the **detail template** alongside **frozen columns** in the Grid:
298+
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid supports frozen columns in combination with a [DetailTemplate](https://blazor.syncfusion.com/documentation/datagrid/detail-template). The detail template displays additional information for a row when expanded, without affecting the frozen column layout.
280299

281300
{% tabs %}
282301
{% highlight razor tabtitle="Index.razor" %}
@@ -405,15 +424,12 @@ public class EmployeeDetails
405424

406425
{% previewsample "https://blazorplayground.syncfusion.com/embed/VZheNULQpBltUNaZ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
407426

408-
> You can freeze the Grid columns either by using the [IsFrozen](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsFrozen) or [FrozenColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenColumns) properties.
427+
> * Freeze columns using either the [IsFrozen](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_IsFrozen) or [FrozenColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenColumns) properties.
409428
410429
## Add or remove frozen columns by dragging the column separator
411430

412-
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid allows you to dynamically add or remove columns from the frozen content by dragging and dropping the column separator. This provides flexibility to customize the Grid layout directly through individual interactions.
413-
414-
To enable this feature, set the [AllowFreezeLineMoving](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_AllowFreezeLineMoving) property to **true** in the Grid.
415-
416-
Here is an example that demonstrates how to enable and use the `AllowFreezeLineMoving` property in the Grid.
431+
The Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid allows dynamically modifying frozen columns by dragging and dropping the column separator. This interaction enables adjusting which columns remain frozen, providing flexibility to customize the layout directly through the Grid UI.
432+
To enable this behavior, set the [AllowFreezeLineMoving](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_AllowFreezeLineMoving) property to **true** in the Grid.
417433

418434
{% tabs %}
419435
{% highlight razor tabtitle="Index.razor" %}
@@ -501,22 +517,24 @@ public class OrderDetails
501517

502518
{% previewsample "https://blazorplayground.syncfusion.com/embed/hZBTMhthBzKufVpW?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
503519

504-
> If frozen columns are not specified, the frozen column separator will be displayed at the left and right ends. You can dynamically change the frozen columns by dragging the column separator.
520+
> If no columns are frozen, the frozen column separator appears at the **left** and **right** edges of the Grid. Columns can be dynamically frozen or unfrozen by dragging the separator.
505521
506522
## Limitations of frozen columns and freeze direction
507523

508524
The frozen columns and freeze direction features in Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid have the following limitations:
509525

510526
**General limitations for frozen columns**
511527

528+
The following features are not compatible with frozen columns:
529+
512530
* Row Template
513531
* Hierarchy DataGrid
514532

515533
**Additional limitations for freeze direction**
516534

517-
* Infinite scroll in cache mode is not supported.
518-
* Freeze direction in the stacked header is incompatible with column reordering.
519-
* Using a cell template or text wrap in any one of the panels may cause variable row heights between the panels. The height is recalculated based on the DOM offset height and applied uniformly across all rows to maintain consistency. This can lead to visual glitches. You can resolve this problem by setting static values for the [RowHeight](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_RowHeight) property in `SfGrid`.
535+
* Infinite scroll in cache mode is not supported.
536+
* Freeze direction in the stacked header is incompatible with column reordering.
537+
* Using a cell template or text wrap in any one of the panels may cause variable row heights between the panels. The height is recalculated based on the DOM offset height and applied uniformly across all rows to maintain consistency. This can lead to visual glitches. To resolve this, set a static value for the [RowHeight](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_RowHeight) property in [SfGrid](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html).
520538
* The [Freeze](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridColumn.html#Syncfusion_Blazor_Grids_GridColumn_Freeze) and [FrozenColumns](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_FrozenColumns) properties are incompatible and cannot be used simultaneously.
521539

522-
> You can refer to our [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid](https://www.syncfusion.com/blazor-components/blazor-datagrid) feature tour page for its groundbreaking feature representations. You can also explore our [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor DataGrid example](https://blazor.syncfusion.com/demos/datagrid/overview?theme=bootstrap5) to understand how to present and manipulate data.
540+
> N> Refer to the [Blazor DataGrid](https://www.syncfusion.com/blazor-components/blazor-datagrid) feature tour for a broad overview. Explore the [Blazor DataGrid example](https://blazor.syncfusion.com/demos/datagrid/overview?theme=bootstrap5) to understand data presentation and manipulation.

0 commit comments

Comments
 (0)