This question is locked. New answers and comments are not allowed.
Hello.
I am trying to use the combobox component into one grid's column to let user select a specific reference entity. What I have done until now based on this example which is exactly what i want to do except the javascript section to bind the selected value.
The code that creates the Grid is
I have created the additional editor for the Commodity reference as below
and the binding works fine. The problem is that the combobox appears in the cell only when i click into it and then disappears when i try to edit some other cell. But when i go click again the cell with combobox it has the selected value that i have entered. Can anyone help.
I am trying to use the combobox component into one grid's column to let user select a specific reference entity. What I have done until now based on this example which is exactly what i want to do except the javascript section to bind the selected value.
The code that creates the Grid is
@(Html.Telerik().Grid<Abe.Common.Procurements.ProcurementOrderLine>() .Name("procurementOrderLines") .DataKeys(keys => keys.Add(line => line.ID)) .ToolBar(commands => { commands.Insert(); }) .DataBinding(databinding => { databinding.Ajax() .Select("_SelectBatchEditing", "ProcurementOrders", new {orderID = Model != null ? Model.ID : 0}) .Update("_SaveBatchEditing", "ProcurementOrders"); }) .Columns(collumns => { collumns.Bound(l => l.ID).Hidden(); collumns.Bound(l => l.Commodity).ClientTemplate("<#= Commodity ? Commodity.Code : null #>").Width(75); collumns.Bound(l => l.QuantityTemp).Width(40); collumns.Command(commands => commands.Delete()).Width(150).Title("Delete"); }) .ClientEvents(events => events.OnSubmitChanges("Grid_onSubmitChanges")) .Editable(editing => editing.Mode(GridEditMode.InCell) .DefaultDataItem(new Abe.Common.Procurements.ProcurementOrderLine { Commodity = new Abe.Common.Transactions.CommodityInfo(), Warehouse = new Abe.Common.Transactions.WarehouseInfo() })) .Scrollable() .Sortable())I have created the additional editor for the Commodity reference as below
@model Abe.Common.Transactions.CommodityInfo@(Html.Telerik().ComboBoxFor(model => model.ID) .AutoFill(true) .BindTo(new SelectList(ViewBag.Commodities, "ID", "Code")) .Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.StartsWith)) .HighlightFirstMatch(true))and the binding works fine. The problem is that the combobox appears in the cell only when i click into it and then disappears when i try to edit some other cell. But when i go click again the cell with combobox it has the selected value that i have entered. Can anyone help.