Hi There
I have a webdropdown that is bound to a sql dataset to populate its items. When the dropdown is opened it will not select the first item in the list. If any other item is selected first then the initial item is reselected it will select OK. Code as follows:
<ig:WebDropDown ID="WebDropDownPrincipalID" runat="server" Width="150px" DropDownAnimationType="Linear" DropDownContainerHeight="0px" DropDownContainerMaxHeight="0px" DropDownContainerWidth="0px" StyleSetName="Trendy" onitemsrequested="WebDropDownPrincipalID_ItemsRequested"> <clientevents focus="wddOpening" /> </ig:WebDropDown>
function wddOpening(sender, e) { sender.loadItems(); }
I have investigated this at length and cannot see what is going on.
Any suggestions??
Hi Brendan,
Ok now i see the issue. Thanks for all the info. Please refer to my second post, and set EnableAutoCompleteFirstMatch="false". It will solve it.
If you want to use EnableAutoCompleteFirstMatch for this scenario, add these two lines as the last lines in the ItemsRequested server-side handler (after you databind the WebDropDown):
this.WebDropDown1.Items[0].Selected = false;
this.WebDropDown1.CurrentValue = "";
Hope this helps. Thanks,
Angel
Hi Angel
Great stuff this did work. The strange thing was that I tried this earlier when you suggested, and it didnt work. The difference was that I actually hardcoded the statement into the wdd tags myself instead of choosing the value from the properties and allowing VS to do the code insert. This should not make a difference but somehow it seems it did. Maybe I have a buggy VS2008??
Anyway thanks for your help. Very much appreciated.
PS can you suggest an online resource that actually breaks down and explains every property that is available on each IG control?? Apologies if this is already available somewhere BUT I have not found it yet.
regards
Brendan
Hi Angel,
I have been having the same issue and in the latest version (2011.1) in that if the user selects the first item it apparently does not select.
However from some testing where I captured the Selction Changed event on the client and checked the selected items and this does show the item that was clicked on by the user. However the display portion of the Web Drop Down remains blank. I tried this, to re-insert the item that should have been showing but with the same result.
wddVariants.set_currentValue(VariantName);
However the following line in the ItemsRequested() on the server code allowed the first item to display if selected.
Me
.wddVariants.CurrentValue = "Select Variant"
However the message here "Select Variant" did not show.
Ken Paton
Thanks, I am glad it works for you.
Usually all properties should have some comments and description available in the Visual Studio "Properties" pane, on the bottom. When you select the property in the Properties window for the control, the description should appear below.
Additionally, you can have a look at: http://ko.infragistics.com/support/documentation.aspx
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.1/CLR3.5/html/Web_API_Reference_Guide.html
For WebDropDown:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.1/CLR3.5/html/Infragistics35.Web.v9.1~Infragistics.Web.UI.ListControls.WebDropDown_members.html