We are currently having problems achieving the same functionality we have in MVC Extensions.
1. In MVC Extensions we have a modified combobox helper below which allows us to set the initial value & text in a 'load on demand' combobox. As part of the helper we also modify the name to change "-input" to "_input" so both the posted value and text can be bound to properties in our view model (ie int abc and string abc_input).
Can you advise how to best achieve this using Kendo MVC combobox as we have been unable to convert the logic below.
return helper.Telerik().ComboBox()
.Name(name)
.InputHtmlAttributes(new
{
id = name + "_input",
name = name + "_input",
value = text
})
.Value(value != null ? value.ToString() : string.Empty);
2. Perhaps related to my issue above but when I select an item from a kendo combobox and post the the results the combobox selection is not maintained when the view is redrawn... in fact the firebug shows only the combobox selected data value is posted
@using (Ajax.BeginForm("Index", "Home", new AjaxOptions { HttpMethod = "POST" }))
{
@(Html.Kendo().ComboBox()
.Name("TestComboID")
.AutoBind(false)
.DataTextField("Text")
.DataValueField("ID")
.Filter("contains")
.DataSource(source =>
{
source.Read(read =>
{
read. Action("GetProducts", "Home")
})
.ServerFiltering(true);
})
)
3. Server Filter
Currently to implement combobox server filtering in MVC extension is quick and easy. The way it has been implemented in Kendo MVC examples requiring .Data to be manually set in the DataSource is clumsy and inefficient given the amount of code required.. If you only have a few combobox's it wouldn't be an issue but we have over 100... Is there any way to improve this so the value is automatically passed when server filtering is on?
Thanks in advance,
Danny
1. In MVC Extensions we have a modified combobox helper below which allows us to set the initial value & text in a 'load on demand' combobox. As part of the helper we also modify the name to change "-input" to "_input" so both the posted value and text can be bound to properties in our view model (ie int abc and string abc_input).
Can you advise how to best achieve this using Kendo MVC combobox as we have been unable to convert the logic below.
return helper.Telerik().ComboBox()
.Name(name)
.InputHtmlAttributes(new
{
id = name + "_input",
name = name + "_input",
value = text
})
.Value(value != null ? value.ToString() : string.Empty);
2. Perhaps related to my issue above but when I select an item from a kendo combobox and post the the results the combobox selection is not maintained when the view is redrawn... in fact the firebug shows only the combobox selected data value is posted
@using (Ajax.BeginForm("Index", "Home", new AjaxOptions { HttpMethod = "POST" }))
{
@(Html.Kendo().ComboBox()
.Name("TestComboID")
.AutoBind(false)
.DataTextField("Text")
.DataValueField("ID")
.Filter("contains")
.DataSource(source =>
{
source.Read(read =>
{
read. Action("GetProducts", "Home")
})
.ServerFiltering(true);
})
)
3. Server Filter
Currently to implement combobox server filtering in MVC extension is quick and easy. The way it has been implemented in Kendo MVC examples requiring .Data to be manually set in the DataSource is clumsy and inefficient given the amount of code required.. If you only have a few combobox's it wouldn't be an issue but we have over 100... Is there any way to improve this so the value is automatically passed when server filtering is on?
Thanks in advance,
Danny