Hi Jason,
We regret for the inconvenience caused. Please ignore the previous response. Your requirement for using DropDown inside Grid in razor can be achieved by setting the CellEditType of the column. Please refer the below code snippet.
[View]
@{ Html.Syncfusion().Grid("SampleGrid")
.Datasource(Model)
.Caption("Orders")
.Column(col =>
{
col.Add(a => a.Id).MappingName("AdminId").HeaderText("Id");
col.Add(a => a.Forename).HeaderText("Forename");
col.Add(a => a.Surname).HeaderText("Surname");
col.Add(a => a.SageAccNo).HeaderText("Account No");
col.Add(a => a.GoldCount).HeaderText("Gold").CellEditType(CellEditType.DropdownEdit);
})
.ClientSideEvents(eve=>{
eve.OnActionBegin("Mapping");
})
.EnablePaging()
.EnableSorting()
.EnableGrouping()
.EnableFiltering()
.ToolBar(tools =>
{
tools.Add(GridToolBarItems.AddNew)
.Add(GridToolBarItems.Edit)
.Add(GridToolBarItems.Delete)
.Add(GridToolBarItems.Update)
.Add(GridToolBarItems.Cancel);
})
.Editing(edit =>
{
edit.AllowEdit(true, "GridBuilder/OrderSave")
.AllowNew(true, "GridBuilder/AddOrder")
.AllowDelete(true, "GridBuilder/DeleteOrder");
edit.EditMode(GridEditMode.Normal);
edit.PrimaryKey(key => key.Add(p => p.Id));
})
.Render();
}
For your convenience, we have created sample and the same can be downloaded from the following link.
Editing MVC Grid588066457.zipWe are unable to reproduce the issue. Could you please modify the above sample reproducing the issue so that we can sort out the issue and provide you with the solution? The information provided would be of great help in resolving the issue.
Please let me know if you have any other questions or concerns.
Regards,
Sridhar.N