I have set a value to my ForeignKey colum in the controller before being sent to the grid. I can see that it is populated in the response body, but not ForeignKey dropdown is visible, when I click then I get the dropdown.
My ForeignKey editor template and below my grid
Thanks
My ForeignKey editor template and below my grid
Thanks
@ModelType Object
@code
Dim DropDown As Kendo.Mvc.UI.DropDownList = Html.Kendo().DropDownListFor(Function(m) m).BindTo(CType(ViewData(ViewData.TemplateInfo.GetFullHtmlFieldName(String.Empty) & "_Data"), SelectList))
DropDown.Render()
End Code
@ModelType IEnumerable(Of EF.Team)
@code
Dim CsvGrid As Kendo.Mvc.UI.Grid(Of BO.Models.Contractor.CsvUploadData) = Html.Kendo.Grid(Of BO.Models.Contractor.CsvUploadData).Name("CsvGrid") _
.Columns(Sub(columns)
columns.Bound(Function(c) c.FirstName)
columns.Bound(Function(c) c.LastName)
columns.Bound(Function(c) c.Email)
columns.Bound(Function(c) c.FirstbookingDate)
columns.Bound(Function(c) c.FullService)
columns.Bound(Function(c) c.PoolSize)
columns.Bound(Function(c) c.Spa)
columns.Bound(Function(c) c.Street)
columns.Bound(Function(c) c.Zipcode)
columns.ForeignKey(Function(f) f.TeamId, Model, "TeamId", "Name").Width(200).Title("Team")
columns.Command(Function(Command) Command.Destroy())
End Sub) _
.ToolBar(Sub(toolbar)
toolbar.Create()
toolbar.Save()
End Sub) _
.Editable(Function(editable) editable.Mode(GridEditMode.InCell)) _
.Pageable() _
.Navigatable() _
.Sortable() _
.Scrollable() _
.DataSource(Function(dataSource) dataSource _
.Ajax() _
.Batch(True) _
.ServerOperation(False) _
.Events(Function(events) events.Error("CsvUpload.GridEditError")) _
.Model(Sub(Model)
Model.Id(Function(d) d.CsvUploadDataId)
Model.Field(Function(f) f.TeamId).DefaultValue(1)
End Sub) _
.Create("Editing_Create", "Grid") _
.Read("csvuploadgriddata", "services", New With {.area = String.Empty}) _
.Update("Editing_Update", "Grid") _
.Destroy("Editing_Destroy", "Grid"))
CsvGrid.Render()
End Code