This looks like another bug in the WebDropDown.
When a WebDropDown is bound to a data source containing several items and the second item in the list is selected and then subsequently this dropdown is bound to a different data source containing only one item, the dropdown seems to be disabled and does not show any value.
This does not happen if any item other than the second in the dropdown is selected before the list is rebound. It also does not happen if the list is rebound to a data source with more that one item.
I have included some code to reproduce the problem: click the 'Set Three' button, select the second item and then click the 'Set One' button.
<form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <ig:WebDropDown ID="WebDropDown2" runat="server" Width="224px" DisplayMode="DropDownList" TextField="second" ValueField="first" AutoPostBackFlags-SelectionChanged="On"><ClientEvents /></ig:WebDropDown><br /> <asp:Button ID="Button1" runat="server" Text="Set One" onclick="Button1_Click" /> <asp:Button ID="Button2" runat="server" Text="Set Three" onclick="Button2_Click" /> </div> </form> <script runat="server"> public class myObject { public myObject(string first, string second) { this.first = first; this.second = second; } public string first { get; set; } public string second { get; set; } } protected void Button1_Click(object sender, EventArgs e) { List<myObject> lTwo = new List<myObject>(); lTwo.Add(new myObject("1", "Not Set")); WebDropDown2.DataSource = lTwo; WebDropDown2.DataBind(); WebDropDown2.SelectedValue = WebDropDown2.Items[0].Value; } protected void Button2_Click(object sender, EventArgs e) { List<myObject> lTwo = new List<myObject>(); lTwo.Add(new myObject("1", "One")); lTwo.Add(new myObject("2", "Two")); lTwo.Add(new myObject("3", "Three")); WebDropDown2.DataSource = lTwo; WebDropDown2.DataBind(); WebDropDown2.SelectedValue = WebDropDown2.Items[0].Value; } </script>
Hi,
When i follow the steps you have described, after clicking on "Set One" button, I get the dropdown bound correctly and showing one item "Not Set" (it's not empty or disabled).
I am using latest code, could you check this scenario with the latest service release? Which build are you currently using?
Thanks for the feedback,
Angel
I believe I'm using the latest service release for .NET 3.5 - 9.1.20091.2067
I have just tried this in IE(v6) and it works. It does not work with firefox 3.5. I haven't tried any other browser versions.
Incidentally, the expandable tree control for the documentation part of your website does not work with firefox 3.5 either - it doesn't show a scroll bar so items towards the bottom are inaccessible. (http://help.infragistics.com/NetAdvantage/ASPNET/2009.1/CLR3.5/)