Hi Everyone
I want to know if someone can help me out a bit, i am trying to use the foreign key columns, which is working just fine, accept, for some reason my kendo grid shows numeric text boxes instead of comboboxes, and i have followed the examples, but with no luck could i get them right :( attached is the code i am using
ViewData gets populated like this, the ModuleViewListDTO string(for values) and long(for ID's) properties
Attached is the results
Regards
Gregory
I want to know if someone can help me out a bit, i am trying to use the foreign key columns, which is working just fine, accept, for some reason my kendo grid shows numeric text boxes instead of comboboxes, and i have followed the examples, but with no luck could i get them right :( attached is the code i am using
@{ Html.Kendo().Grid<EasyAssets.Model.DTO.HomologationItemDTO>() .Name("itemsGrid") .Columns(c => { c.Bound(e => e.HomologationItemPriceID).ClientTemplate("<input id='#=ItemPriceID#' type='checkbox'/>").Template(t => "<input id='" + t.ItemPriceID + "' type='checkbox'/>").Title("").Width(30); c.Bound(e => e.ItemPriceID).Filterable(false).Visible(false); c.Bound(e => e.Item); c.Bound(e => e.ItemPrice).Width(120); c.ForeignKey(e => e.PriorityID, (System.Collections.IEnumerable)ViewData["priorities"], "id", "datatext").Title("Priority").Width(170); c.ForeignKey(e => e.StatusID, (System.Collections.IEnumerable)ViewData["statuses"], "id", "datatext").Title("Status").Width(170); }) .Editable(e => e.Mode(GridEditMode.InCell)) .Sortable() .Pageable() .Filterable() .Scrollable() .Selectable(e => e.Mode(GridSelectionMode.Multiple)) .AutoBind(false) .DataSource(e => e.Ajax() .Batch(true) .ServerOperation(false) .PageSize(7) .Events(g => g.Error("ItemGridError")) .Model(m => { m.Field(f => f.ItemPrice).Editable(false); m.Field(f => f.Item).Editable(false); m.Id(i => i.HomologationItemPriceID); }) .Read(r => { r.Action("GetItems", "StockInspection"); r.Data("GetItemGridData"); } ) ) .Render(); }ViewData gets populated like this, the ModuleViewListDTO string(for values) and long(for ID's) properties
ViewData["priorities"] = _priorities = JsonConvert.DeserializeObject<ModuleViewListDTO>(GetOrPost("get", ApiUrl + "/api/Items?lookup=Priority", "")).data; ViewData["statuses"] = _statuses = JsonConvert.DeserializeObject<ModuleViewListDTO>(GetOrPost("get", ApiUrl + "/api/Items?lookup=ItemStatus", "")).data;Attached is the results
Regards
Gregory