Hi,
I have an issue with dropdownlist, with run twice the databound (read action)
In my case, I customized the dropdownlist to manage the pagination :
Html.Kendo().DropDownList()
.Name(Model.ElementId)
.DataTextField(Model.LovTextField.Name)
.DataValueField(Model.LovField.Name)
.Value(Model.Value.ToString())
.IgnoreCase(Model.SearchIgnoreCase)
.Enable(Model.IsEnabled)
.Animation(false)
.AutoWidth(true)
.Template(Model.ClientTemplate)
.ValueTemplate(Model.ClientTemplate)
.DataSource(source =>
{
source.Custom()
.ServerFiltering(true)
.ServerPaging(true)
.PageSize(50)
.Type("aspnetmvc-ajax")
.Transport(transport =>
{
transport.Read("ReadLovData", "DropDownList", new { area = "Runtime", pageid = ViewBag.PageContext.PageId, elementid = Model.ElementId });
})
.Schema(schema =>
{
schema.Data("Data") //define the [data](http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.data) option
.Total("Total"); //define the [total](http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.total) option
}).Events(e => e.RequestEnd(@<text>function(e) {requestEnd(e,"@Model.ElementId");}</text>));
})
.Virtual(v =>
{
v.ValueMapper("dropDownListValueMapper")
.MapValueTo("dataItem");
})
.FooterTemplate("<span class='k-state-hover'>Page #: instance.dataSource.page() # / #: instance.dataSource.totalPages() # - Total #: instance.dataSource.total() # items found</span>")
dropDownListValueMapper is a javascript function that calls an controller/action via ajax in POST mode
requestEnd is a javascript function that that does nothing in this case
In the attached file, I have an example of a page with 3 dropdownlists; and we see for each of them the call of a second databound, just before the call of the valuemapper
Like you can see, we are in ASP.NET MVC, and I'm not good enough in javascript to replicate an example on dojo (especially in server mode)
I also noticed that the example on databound customization did not work properly (https://demos.telerik.com/aspnet-mvc/dropdownlist/custom-datasource), but with the example provided with the DLL it works locally. However there is no valuemapper, so ...
Note that I just went to the latest version (2018-R1), and I use Visual Studio 2015 (C#)
Thanks,
Thierry