[]
CellEditingTemplate enables customization of the editor displayed when a cell enters edit mode.
Editors can be implemented using:
ComponentOne input controls
Blazor framework controls
Native HTML input elements
This approach enables flexible in-place editing experiences while preserving integration with the FlexGrid editing pipeline.
The following example defines a C1TextBox editor using the GridColumn.CellEditingTemplate property.
<GridColumn Binding="Symbol" Width="100">
<CellEditingTemplate>
@{
var casted = (FinancialData)context.DataItem;
}
<C1TextBox
@ref="context.Editor"
@bind-Text="casted.Symbol" />
</CellEditingTemplate>
</GridColumn>The following example defines an InputText editor using the GridColumn.CellEditingTemplate property.
<GridColumn Binding="Symbol" Width="120">
<CellEditingTemplate>
@{
var casted = (FinancialData)context.DataItem;
}
<InputText
@ref="context.Editor"
@bind-Value="casted.Symbol" />
</CellEditingTemplate>
</GridColumn>The following example defines a native HTML <input> element as the cell editor.
<GridColumn Binding="Symbol" Width="120">
<CellEditingTemplate>
@{
var casted = (FinancialData)context.DataItem;
}
<input
@bind="casted.Symbol"
@bind:event="oninput" />
</CellEditingTemplate>
</GridColumn>After configuring a CellEditingTemplate, the specified editor is displayed whenever the cell enters edit mode.
As a result, FlexGrid supports customizable in-place editing experiences using ComponentOne controls, Blazor framework controls, or native HTML elements depending on application requirements.
Important:
Rendering large numbers of interactive component instances inside grid cells may increase rendering cost and affect scrolling performance.
For large datasets, native HTML elements are generally more efficient than component-based controls.
CellEditingTemplateworks only with non-primitive data types.Editor focus occurs automatically only when the editor inherits from
C1Viewand implements focus functionality. For example, ComponentOne controls such asC1TextBoxandC1ComboBoxsupport automatic focus behavior.For Blazor framework controls or native HTML elements, focus behavior may need to be handled separately depending on the editor implementation.