Posted 31 March 2023, 12:41 am EST
Hello Daniel,
To implement the above requirement, we may use the GridCellFactory class which is used to create every cell which is rendered on the FlexGrid.
You may overwrite the “GetCellContentRenderFragment” method of the GridCellFactory Class, check if the RowPosition is Top, then you could render empty string in the cell next to the frozen Column.
Kindly refer to the following code snippet and the attached Sample:
public class MyCellFactory : GridCellFactory
{
public override RenderFragment GetCellContentRenderFragment(GridCellType cellType, GridCellRange range)
{
if (cellType == GridCellType.Cell && range.Column == grid.FrozenColumns
&& grid.NewRowPosition == GridNewRowPosition.Top && range.Row == 0)
{
// Render a Fragment with Empty String
RenderFragment rf3 = (builder) =>
{
builder.OpenElement(0, "text");
builder.AddContent(1, String.Empty);
builder.CloseElement();
};
return rf3;
}
else
{
return base.GetCellContentRenderFragment(cellType, range);
}
}
}
Similary you could check if the NewRowPosition is Bottom, then you could render Empty String in the Bottom Row next to the Frozen Column.
GetCellContentRenderFragment method: https://www.grapecity.com/componentone/docs/blazor/online-blazor/C1.Blazor.Grid~C1.Blazor.Grid.GridCellFactory~GetCellContentRenderFragment(GridCellType,GridCellRange).html
Regards,
Ankit
Sample: FlexGrid_FreezedColumns_NewRowTemplate.zip