Im using DropDownList with remote data binding and it works great on Firefox and Chrome, but there is an issue with filtering on Internet Explorer. After few keystrokes it selects top filtered position automatically instead of just filter out unmatching positions.
Code i use:
01.
Html.Kendo().DropDownList()
02.
.Name(
"DropDown"
)
03.
.DataTextField(
"Text"
)
04.
.DataValueField(
"Value"
)
05.
.Filter(FilterType.Contains)
06.
.DataSource(source =>
07.
source.Read(read =>
08.
{
09.
read.Action(
"ReadMethod"
,
"Applications"
);
10.
}))
11.
.Events(e =>
12.
{
13.
e.Select(
"onSelect"
);
14.
e.DataBound(
"onLoad"
);
15.
})
Is there anything that can be done to fix that?
7 Answers, 1 is accepted
I was not able to reproduce the described behavior at my end. Could you elaborate more on the following points:
1. If there are specific steps that need to be followed in order for the issue to be exhibited could you share them?
2. Is the unexpected behavior reproducible in any of our demos, for example in the Client Filtering or the Server Filtering demos, in which the DropDownList is configured similarly to yours?
3. If there is any additional custom logic in the DataBound event handler that could be interfering with the DropDownList built-in behavior could you post it?
Regards,
Ivan Danchev
Telerik by Progress
[quote]
1. If there are specific steps that need to be followed in order for the issue to be exhibited could you share them?
[/quote]
There are no additional steps beside typing letters into filter field.
[quote]
2. Is the unexpected behavior reproducible in any of our demos, for example in the Client Filtering or the Server Filtering demos, in which the DropDownList is configured similarly to yours?
[/quote]
Both examples works fine in Internet Explorer.
[quote]
3. If there is any additional custom logic in the DataBound event handler that could be interfering with the DropDownList built-in behavior could you post it?
[/quote]
Strangely enough when I took out all the events and configured my DropDownList exactly like one in demo (ofcourse populating it with my own read method) the problem still occurs. In my read method in controller I return list of SelectItems with Json method, like so:
List<SelectItem> selectList =
new
List<SelectItem>();
//list populating logic...
return
Json(selectList, JsonRequestBehavior.AllowGet);
Since I think I got rid of everything on client side that could interfere with widget behavior I have no idea what else could it be.
Have you debugged you ReadMethod action? Is the expected collection of items returned based on the text typed in the DropDownList? Here's an exemplary action that works correctly at my end:
public
JsonResult GetProducts(
string
text)
{
var products1 =
new
List<SelectItem>();
products1.Add(
new
SelectItem { Text =
"anna"
, Value =
"1"
});
products1.Add(
new
SelectItem { Text =
"alice"
, Value =
"2"
});
products1.Add(
new
SelectItem { Text =
"bob"
, Value =
"3"
});
products1.Add(
new
SelectItem { Text =
"ben"
, Value =
"4"
});
products1.Add(
new
SelectItem { Text =
"daniel"
, Value =
"5"
});
products1.Add(
new
SelectItem { Text =
"donald"
, Value =
"6"
});
if
(!
string
.IsNullOrEmpty(text))
{
products1 = products1.Where(p => p.Text.Contains(text)).ToList(); ;
}
return
Json(products1, JsonRequestBehavior.AllowGet);
}
Regards,
Ivan Danchev
Telerik by Progress
There has been a similar DropDownList issue in previous Kendo UI versions, but it has been fixed and should not be reproducible with the latest official version. I would suggest checking out the version of the Kendo js files loaded as well as the version of the Kendo.MVC.dll assembly referenced in your project. A version older than 2017.1.223 (as specified in the ticket's info) referenced, could explain why the issue is not replicated in our demos but can be observed in your project.
Regards,
Ivan Danchev
Telerik by Progress
Well, it's embarrasing that I didn't check the latest version.With new version problem is indeed gone.
Thank you for your help.
Thank you for getting back to us. I am glad we were able to narrow down the cause for the issue and that it is not reproducible in the latest Kendo UI version.
Regards,
Ivan Danchev
Telerik by Progress