Hi,
I am using 2 webdropdowns on a page in my web application.
1) Group webdropdown
2) Subitems webdropdown
The values in the Subitems dropdown varies depending upon what is selected from the Group dropdown. To accomplish this, I am using a
SelectionChanged client-side event with the Group webdropdown as follows:
aspx page code:
<ig:WebDropDown id="Groupdropdown" runat="server" cssclass="igdd_Control" Height="12px" Width="400px" EnableAnimations="False" EnableCustomValues="False">
<ClientEvents SelectionChanged ="loadsubItems"/></ig:WebDropDown>
<ig:WebDropDown id="SubItemsdropdown" runat="server" cssclass="igdd_Control" Height="12px" Width="415px" EnableAnimations="False" EnableCustomValues="False" OnItemsRequested="cmbSubItems_OnItemsRequested">
javascript code:
function loadsubItems(sender, e) {
var subItemsCmb;
subItemsCmb= $find("SubItemsdropdown");
subItemsCmb.set_currentValue("", true);
subItemsCmb.loadItems(e.getNewSelection()[0].get_value(),false);
}
Code-behind vb code:
Protected Sub cmbSubItems_OnItemsRequested(ByVal sender As Object, ByVal e As Infragistics.Web.UI.ListControls.DropDownItemsRequestedEventArgs)
// Code to check e.value and then populate the subitems dropdown based upon e.value
End Sub
The problem that I am facing is:
As soon as I type a character in the group dropdown, the control is automatically going to the subitems dropdown. Suppose, there are 2 values in the group dropodown as follows:
0100 POLITICS
0200 SCIENCE
As soon as I type "0", "0100 POLITICS' is getting selected and control is automatically going to the subitems dropdown. If I type "02" quickly, only 02 remains in the dropdown and control is automatically going to the second dropdown.
I don't want the control to automatically go to the subitems dropdown. When I type 0 in the group dropdown, I should have the capability to select any value starting with "0". Moreover, only the items present in the dropdown should appear in the textfield.
Please let me know how to accomplish this.
Thanks,
Sunil Mehta.
Any suggestions please?
Hello Sunil,
Moving focus to the next dropdown is expected behavior. The functionality you are trying to achieve is not possible with enabled auto-filtering, because every time you type a character, the SelectionChanged event is raised. The second dropdown is populated with corresponding values and the focus is moved on it.
Let me know if you have any questions.
Any solution so that user can have the ability to select the item by pressing the "Enter" key.
Hi Sunil,
By design the WebDropDown control does not raise SelectionChanged event when Enter is pressed. I would suggest you to check our jQuery Combo Box, which offers functionality similar to what you required - http://es.infragistics.com/products/jquery/sample/combo-box/combo-load-on-demand.
If you have any other questions, please let me know.
Hi Nikolay,
We have already purchased webdropdown recently. So, moving to another product just to enable one option does not make sense. Also, even if we purchase the combo box suggested by you, there is no guarantee that whatever features are atleast working now with webdropdown, will work with combo box as well.
I am looking for a solution to my problem within the webdropdown if possible.
To add further into the above post, try typing a text in the dropdown. If a user does not press Enter or select an item explicitly, the item is not getting selected but user gets an illusion that an item has been selected. This is because the typed item looks like the current value in the webdropdown. This is a bad illusion to the user. A normal user does not know whether the dropdown is a combo-box or a normal dropdown. If a dropdown has a typing feature, then the above discussed are the basic features that a product should have.
We are looking for a solution to this.
I am just checking if the latest reply helped you out and if you require any further assistance on the matter.