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 property of FlexGrid class, which takes values from the GridNewRowPosition Enumeration. In the new row template, the display value can be set using NewRowPlaceHolder property.
The GIF below shows the implementation of adding a new row template to the FlexGrid.
The following code example demonstrates how to implement addition of new row in FlexGrid.
Razor |
Copy Code
|
---|---|
@page "/FlexGrid/NewRow" @using Localization @using C1.Blazor.Grid <FlexGrid ItemsSource="customers" NewRowPosition="GridNewRowPosition.Top" NewRowPlaceholder="@FlexGridRes.NewRowPlaceholder" AllowDragging="GridAllowDragging.Both" HeadersVisibility="GridHeadersVisibility.All" SelectionMode="GridSelectionMode.RowRange" IsVirtualizationEnabled="false" Style="@("max-height:50vh")" /> @code{ CustomDataCollection<Customer> customers; protected override void OnInitialized() { customers = new CustomDataCollection<Customer>(Customer.GetCustomerList(100)); }} |