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 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
Hi Brendan,
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
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
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,
Hi Again
The process is as follows.
The wdd in question is Principal. Shot 1 shows nothing selected on a newly refreshed page
Shot 2 the first item in the list is chosen then the dropdown will close but the item will not show in the text area
Shot 3 the dropdown can then be opened again and the first item is shown in the style as selected but still not shown in the text area.
If the second item in the list is selected it will show perfectly and now the first item can be selected and will show as normal.
????????????
Thanks in advance