Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Saturday, April 13, 2013 6:36 PM
hello,
using combobox... simple example:
<asp:ComboBox ID="yadayada" runat="server"
CssClass="ComboBoxInsideModalPopup"
DropDownStyle="DropDownList"
AutoCompleteMode="SuggestAppend"
CaseSensitive="false">
<asp:ListItem Text="One" Value="One"></asp:ListItem>
<asp:ListItem Text="Two" Value="Two"></asp:ListItem>
<asp:ListItem Text="Three" Value="Three"></asp:ListItem>
</asp:ComboBox>
it's supposed to be just like a combobox in winForms applications... I need to create a web form very efficient for data input via keyboard, so the combobox *should* be perfect for tabbing into from previous field, then just start typing and the AutoCompleteMode should kick in and start showing closest matches. I specifically need to only allow values in the list. However after tabbing into the combobox from the previous field I start to type and nothing appears... however if I click with the mouse the control to show the list, the list shows, *then* if I click inside the area to type and start typeing it works. If I change the DropDownStyle to Dropdown, it works exactly as I expect when tabbing into the control from the previous control, but setting to Dropdown also allows the user to enter values not in the list.
what's going on? Major disappointment. I've already installed latest version of the toolkit (January 2013 release), using VS 2008, framework 3.5.
All replies (4)
Monday, April 15, 2013 10:18 PM âś…Answered
I came up with a work-around. I set the selectedIndex property on pageLoad event and it then works as expected.
cboAddOrEdit_Inventory_Class.SelectedIndex = 0;
cboAddOrEdit_Inventory_ItemType.SelectedIndex = 0;
I just make sure that index zero is my prompt value, like "Select an ItemType", or "Type..."
Saturday, April 13, 2013 9:49 PM
maybe there is a property similar allowcustomtext you can set true/false
Monday, April 15, 2013 11:01 AM
Hi oned_gk, thanks for the reply. I don't see any allowCustomText property. I believe that is supposed to be controlled through the DropDownStyle property.
from http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx
DropDownStyle - Determines whether the user is allowed to enter text that does not match an item in the list, and whether the list is always displayed. If "DropDownList" is specified, users are not allowed to enter text that does not match an item in the list. When "DropDown" (the default value) is specified, any text is allowed. If "Simple" is specified, any text is allowed and the list is always displayed regardless of the AutoCompleteMode property value.
so mine is set to "DropDownList", which should allow the user to start typing in the text box and show matching results based on AutoCompleteMode being SuggestAppend. It is ONLY when you tab into the textbox for the FIRST TIME, and start typing that is doesn't work, you can't type, but if you click the button to show the list and select an item, then click back into the textbox, you can type and it works... you delete existing selection and start typeing and it works exactly as expected.
The requirement I'm working with is users must be able to fill out a field, tab to the next, fill it out, tab to the next, fill it out etc... no mouse should be nesessary... currently when they tab to the combobox textbox they can't type. No good.
Monday, April 15, 2013 3:38 PM
some more info:
I just did a simple example of comboBox on a different machine and it worked fine, here are the most obvious differences:
worked on:
visual studio 2010 sp1, .net fw 4.0, in stripped down aspx page, no master page, no modal form
UPDATE: tested with masterpage and modal form in play also, still worked.
is NOT working on:
visual studio 2008 w/ latest service pack, .net 3.5, project uses master pages, and the control is in a modal form
In the case of it not working, there is also no data shown in the textbox (unless you click the button to show the dropdown list), whereas in the case of it working fine, there is data in the textbox right away, the first list item.
Anyone have any ideas? anyone seen this issue before? unfortunately right now getting VS 2010 on the other dev machine and updating the app to the 4.0 framework is not an option. I need to get it working with VS 2008 and 3.5 framework.