# Setting up Row Edit Templates

Learn how you can allow a row edit template to be displayed so the user can edit the contents of an entire row using a specified template or form.

## Content

You can allow a row edit template to be displayed so the user can edit the contents of an entire row using a specified template or form. In the example shown here, the entire row of data is presented to the user as a vertical form with an Update and **Cancel** button at the bottom of the form.
![Row Edit Template Example](https://cdn.mescius.io/document-site-files/images/346c9178-0ed8-4fb9-908b-1565b22fb408/artwork/template-edit.png)
The API members that are involved with this feature include:

* FpSpread.[RowEditTemplate](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.RowEditTemplate.html) property
* SheetView.[RowEditTemplate](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.RowEditTemplate.html) property
* [RowEditTemplateContainer](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.RowEditTemplateContainer.html) class and its members

In most cases, you can use [RowEditTemplateContainer](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.RowEditTemplateContainer.html) for the template control. But the editing template can contain other kinds of controls. In these cases, you must develop code to update the data of these controls.
When users double click a row, the row edit template appears. Then users can edit the data of the row, and press the **Update** link button to commit changes or press the **Cancel** link button to discard the changes.
The row edit template supports XML serialization so custom editing template can be saved and loaded along with Spread.
You can create the row edit template at design time or run time.

## Using Code

Set the [EnableRowEditTemplate](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.EnableRowEditTemplate.html), [EnableClientScript](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.EnableClientScript.html), and [OperationMode](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.OperationMode.html) properties.

## Example

This example code sets the [EnableRowEditTemplate](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.EnableRowEditTemplate.html) property.

```csharp
FpSpread1.ActiveSheetView.EnableRowEditTemplate = true;
FpSpread1.EnableClientScript = true;
FpSpread1.ActiveSheetView.OperationMode = FarPoint.Web.Spread.OperationMode.RowMode;
```

```vbnet
FpSpread1.ActiveSheetView.EnableRowEditTemplate = True
FpSpread1.EnableClientScript = True
FpSpread1.ActiveSheetView.OperationMode = FarPoint.Web.Spread.OperationMode.RowMode
```

## Using Design Settings

1. Select **Edit Templates** from the Spread smart tag.
2. Select **Editing Template** from the drop-down.
3. Drag the FpSpreadTemplateReplacement control from the Visual Studio toolbox to the edit template area.
4. Select a task (such as CellType) and specify the column index.
5. Add code to set **EnableRowEditTemplate** to true and **OperationMode** to row mode (see above code).
6. Run the project and double-click a cell in column 0 to edit it.

## See Also

[OperationMode Property](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.OperationMode.html)
[EnableRowEditTemplate Property](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.EnableRowEditTemplate.html)
[EnableClientScript Property](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.EnableClientScript.html)