# Using AutoComplete as Custom Column Editor

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Grid for Progress® Telerik® UI for UI for ASP.NET MVC </td>
 </tr>
</table>

## Description

How can I use the Telerik UI for ASP.NET MVC AutoComplete as a custom column editor for the Grid in Telerik UI for ASP.NET MVC?

## Solution

1. Create an editor template within the following directory - "\~\Views\Shared\EditorTemplates"
2. Pass the newly created view name to the following column configuration :

```Razor
columns.Bound(p => p.ProductName).EditorTemplateName("CustomEditorName");
```

#### Example

```Razor Index.cshtml

@(Html.Kendo().Grid<GridExample.Models.ProductViewModel>()
    .Name("Grid")
    .Columns(columns => {
        //columns.Bound(p => p.ProductName).EditorTemplateName("AutoCompleteEditor");
        columns.Bound(p => p.ProductName).EditorTemplateName("ComboBoxEditor");
        columns.Command(command => command.Destroy());
    })
    .Pageable()
    .Editable(editable => editable.Mode(GridEditMode.InCell))
    .Scrollable()
    .ToolBar(t => { t.Create(); t.Save(); })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(true)
        .PageSize(20)
        .ServerOperation(false)
        .Model(model => model.Id(p => p.ProductID))
        .Create("Create", "Grid")
        .Read(r=>r.Action("Read", "Grid"))
        .Update(u=>u.Action("Update", "Grid"))
        .Destroy("Destroy", "Grid")
    )
)

```

```Razor AutoCompleteEditor.cshtml
@model string

@(Html.Kendo().AutoCompleteFor(m => m)
      .Placeholder("Select name...")
      .BindTo(new List<string>() {
            "My new name 1",
            "My new name 2",
            "My new name 3",
      }))

```

```Razor ComboBoxEditor.cshtml
@model string

@(Html.Kendo().ComboBoxFor(m => m)
      .Placeholder("Select name...")
      .BindTo(new List<string>() {
          "My new name 1",
          "My new name 2",
          "My new name 3"
      })
      .HtmlAttributes(new { style="width:100%;" }))

```

## More ASP.NET MVC Grid Resources

* [ASP.NET MVC Grid Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/data-management/grid/overview)

* [ASP.NET MVC Grid Demos](https://demos.telerik.com/aspnet-mvc/grid/index)

* [ASP.NET MVC Grid Product Page](https://www.telerik.com/aspnet-mvc/grid)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Client-Side API Reference of the Grid for ASP.NET MVC](https://docs.telerik.com/kendo-ui/api/ui/grid)
* [Server-Side API Reference of the Grid for ASP.NET MVC](https://docs.telerik.com/aspnet-mvc/api/grid)
* [Telerik UI for ASP.NET MVC Breaking Changes](https://www.telerik.com/aspnet-mvc/documentation/backwards-compatibility/2023-backwards-compatibility)
* [Telerik UI for ASP.NET MVC Knowledge Base](https://docs.telerik.com/aspnet-mvc/knowledge-base)
