This question is locked. New answers and comments are not allowed.
Hi,
I am using a ComboBox with ajax bindings. When I initially select the item & post to the server and back the selected value is maintained correctly (think create page). However if I then load a page and set the value the item is not selected in the combo box (think edit page).
e.g.
m.ModelId is correctly set with the value and the javascript initalizer is created as
However the page loads up and the combobox remains empty. If I then open the combobox it loads the items from the server and selects the correct one automatically.
Is there a way to make it load the item from the server and select it automatically on page load.
Thanks
Nathan
I am using a ComboBox with ajax bindings. When I initially select the item & post to the server and back the selected value is maintained correctly (think create page). However if I then load a page and set the value the item is not selected in the combo box (think edit page).
e.g.
@(Html.Telerik().ComboBoxFor(m => m.ModelId)
.DataBinding(binding => binding.Ajax().Select("Method", "Controller"))
.Filterable(filtering =>{filtering.FilterMode(AutoCompleteFilterMode.Contains);})
.HighlightFirstMatch(true).HtmlAttributes(new { style = "width:260px" })
)
m.ModelId is correctly set with the value and the javascript initalizer is created as
jQuery(
'#OrderItems\\[2\\]_ModelId'
).tComboBox({autoFill:
false
, ajax:{
"selectUrl"
:
"/Controller/Method"
}, filter:2, selectedValue:
'3473'
});
However the page loads up and the combobox remains empty. If I then open the combobox it loads the items from the server and selects the correct one automatically.
Is there a way to make it load the item from the server and select it automatically on page load.
Thanks
Nathan