I can't figure out how to get the WebDropdown to autopostback ONLY when I have actually selected an item.
Using your own example shows the problem that I'm having. Please go to this page:
http://samples.infragistics.com/2009.1/WebFeatureBrowser/contents.aspx?showCode=True&t=WebDropDown/WebDropDownServerEvents.aspx~srcview.aspx?path=~srcview.aspx?path=WebDropDown/WebDropDownServerEvents.src
Now, click in the webDropDown, delete the text, and type just a 'B'. An autopostback happens, and says that I have selected "Berglunds snabbköp". Which is not the case - the webdropdown only has a 'B' in it.
I don't want a postback to happen until I either hit <enter> or click on a item. To further clarify my need, lets say that you actually wanted to select the second "B" item, which is "Blauer See Delikatessen". I want to be able to type "Bl" and not have a postback happen after the "B".
In my case, I'm setting EnableAutoFiltering="Client", which will filter the results. So, I want to be able to type a "B", and the result is filtered, BUT no postback happens yet, because I haven't selected anything yet. Then I type"L" (which filters, so "Blauer See Delikatessen", is now the first item - the item that I really want, so I now hit <enter>. This is when I want the autopostback to happen - because only now have I actually selected something. Up until now, I've only been typing.
Thanks,Jim
Hello Jim,
Let me know if you need further assistance.
It still doesn't work correctly. Here's my code: <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" TextField="Prod_Code" ValueField="Prod_ID" AutoSelectOnMatch="false" EnableAutoFiltering="Client" OnSelectionChanged="WebDropDown1_SelectionChanged" DataSourceID="SqlDataSource1"> <AutoPostBackFlags SelectionChanged="On" ValueChanged="Off" /> </ig:WebDropDown> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TravelerMakerGUIConnectionStringXXXX %>" SelectCommand="SELECT [Prod_Code], [Prod_ID] FROM [ProductCodes]"> </asp:SqlDataSource> </div> </form>The desired behavior is: A postback should only happen when:1) an item is selected with the mouse (this works)2) Only when the <enter> key is hit (not working) - postpacks also happen at other times.If the list is a bunch of part numbers like:abc-123abc-124abc-125def-123def-124Now, using my code and part numbers from above, select abc-124 with the mouse. a postback happens - this is correct.Now, pretend that you made a mistake, and you really wanted one of the def-123 parts. So, rather than use the mouse, you highlight the abc-123 item, and start typing 'D'..... A postback happens. I did not select a full partnumber, I just typed a 'D', and a postback happened. This postback should not happen, I did not select a part number. A postback should only happen if an item is selected with the mouse, or if I hit the <enter> key. Thanks, Jim
Thank you for the detailed descriprion of your Use case.
I think that the below configuration of WebDropDown matches your requirements:
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" TextField="LastName"
ValueField="EmployeeID" DataSourceID="SqlDataSource1" AutoSelectOnMatch="false"
EnableClosingDropDownOnSelect="false" EnableAutoCompleteFirstMatch="false"
KeepFocusOnSelection="false" EnableAutoFiltering="Client" OnSelectionChanged="WebDropDown1_SelectionChanged">
<AutoPostBackFlags SelectionChanged="On" ValueChanged="Off" />
<DropDownItemBinding TextField="LastName" ValueField="EmployeeID" />
</ig:WebDropDown>
Just to let you know that I am using the latest service release of 10.3 version (10.3.20103.2056)
Also keep in mind that WebDropDown supports keyboard navigation and if you use Up/Down arrow keys the items will be selected.
Hope this helps.
Yes, I'm using the latest service pack.
You had me add two tags (EnableClosingDropDownOnSelect="false" EnableAutoCompleteFirstMatch="false")
This did not help. Again, the problem is simple to see:1) After the page loads, Select an item with the mouse (any item). A postback happens, this is correct.2) Now, HIGHLIGHT the text which is the item that you just selected above. Hit any other key on the keyboard. A postback will happen. This is NOT correct. I did not select a different item yet, All I did was hit the first character of my new choice.
Jim
I have version 14.2 installed. Is this fixed. I am having same issue?
2015 and the Problem still remains! Seems jdresser did the right Thing...
I am using Infragistics 14.2 and I am currently having this same issue.
The WebDropDown is posting back as I type in the dropdown and never autoselects the first match.
<ig:WebDropDown ID="ddl_Location" runat="server" Width="160px" AutoPostBack="true" DataSourceID="SqlDataSource3" TextField="LAST_NAME" ValueField="ENTITY_ID" CssClass="Required" NullText="Required" DisplayMode="DropDown" EnableCustomValueSelection="false" EnableCustomValues="false" AutoSelectOnMatch="true"></ig:WebDropDown>
Hi Lonnie,
Just try this dirty workaround, it did the trick for me:
<script type="text/javascript">
var keyDown = null;
function ddl_KeyDown(sender, eventArgs) {
if (eventArgs._props[0].keyCode != 13)
keyDown = true;
else
keyDown = false;
}
function ddl_SelectionChanging(sender, eventArgs) {
if (keyDown !== null && keyDown)
eventArgs.set_cancel(true);
</script>
I’m just left with the issue that a TAB doesn’t trigger selectionchanged-event.
I'm using Version 13.2, and this issue still exists. When I use the down arrow to navigate through the items it causes a postback. In my mind, it should only postback if I hit enter or click an item. Can someone please help me! This is an urgent issue. here is my code:
DropDownContainerHeight="0px" DropDownContainerMaxHeight="200px" DropDownContainerWidth="150px" NullText="-- Select One --" AutoSelectOnMatch="False" KeepFocusOnSelection="false" EnableAutoCompleteFirstMatch="false" EnableAutoFiltering="Client" EnableCustomValueSelection="false" EnableCustomValues="false" EnableMarkingMatchedText="True" OnSelectionChanged="ddlSepCode_SelectionChanged">