# Add New Row

Adding a new row in Blazor Grid using new row template.

## Content



FlexGrid allows you to add a new row using new row template. The row can be added at the top or bottom of the grid using [NewRowPosition](/componentone/api/blazor/online-blazor/dotnet-api/C1.Blazor.Grid/C1.Blazor.Grid.FlexGrid.NewRowPosition.html) property of [FlexGrid](/componentone/api/blazor/online-blazor/dotnet-api/C1.Blazor.Grid/C1.Blazor.Grid.FlexGrid.html) class, which takes values from the [GridNewRowPosition](/componentone/api/blazor/online-blazor/dotnet-api/C1.Blazor.Grid/C1.Blazor.Grid.GridNewRowPosition.html) Enumeration. In the new row template, the display value can be set using [NewRowPlaceHolder](/componentone/api/blazor/online-blazor/dotnet-api/C1.Blazor.Grid/C1.Blazor.Grid.FlexGrid.NewRowPlaceholder.html) property.

The GIF below shows the implementation of adding a new row template to the FlexGrid.

![FlexGrid new row](https://cdn.mescius.io/document-site-files/images/f5b600ba-f1a7-4f89-a20c-aa6c0c35880d/images/row_new2.gif)

The following **code example** demonstrates how to implement addition of new row in FlexGrid. The following example uses the same data as used in [Quick Start](/componentone/docs/blazor/online-blazor/controls/flexgrid/flexgrid_quickstart).

```razor
@page "/FlexGrid/NewRow"
@using FlexGrid_NewRow_Server.Data
@inject WeatherForecastService ForecastService
@using C1.Blazor.Grid
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from a service.</p>
@if (forecasts == null)
{
    <p><em>Loading...</em></p>
}
else
{
    <FlexGrid ItemsSource="forecasts" NewRowPosition="GridNewRowPosition.Top" NewRowPlaceholder="Click to add new row" AllowDragging="@GridAllowDragging.Both" HeadersVisibility="@GridHeadersVisibility.All" SelectionMode="@GridSelectionMode.RowRange"
IsVirtualizationEnabled="false"></FlexGrid>  
}
@code {
    private WeatherForecast[]? forecasts;
    protected override async Task OnInitializedAsync()
    {
        forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
    }
}                
```