Hi Michael,
Thanks for contacting Syncfusion support.
We have analyzed your query and based on your requirement we have prepared a sample that can be downloaded from the below link.
In this sample we have achieved your requirement by using EditTemplate property of columns in grid. In EditTemplate we have rendered Autocomplete control. Also we have enabled the property as showPopupButton to view it as dropdown.
Please refer the below code example.
[Index.cshtml]
@(Html.EJ().Grid<MVCSampleBrowser.Models.EditableOrder>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowPaging()
...
.Columns(col =>
{ ...
col.Field("CustomerID").HeaderText("CustomerID").EditTemplate(a => { a.Create("create").Read("read").Write("write"); }).Width(100).Add();
})
)
<script type="text/javascript">
function create() {
return $("<input>");
}
function write(args) {
obj = $('#FlatGrid').ejGrid('instance');
var data = ej.DataManager(obj.model.dataSource).executeLocal(new ej.Query().select("CustomerID"));
args.element.ejAutocomplete({ width: "100%", dataSource: data,showPopupButton: true , enableDistinct: true, value: args.rowdata !== undefined ? args.rowdata["CustomerID"] : "" });
}
function read(args) {
return args.ejAutocomplete("getValue");
}
</script> |
Also please refer the documentation link.
Online sample link about EditTemplate,
Please let us know if you need further assistance.
Regards,
Manisankar Durai.