Using 2009.1 controls.
I've added a WebDropdown to my edititemtemplate in a formview. I've enabled multiselect and bound it to a datasource.
<ig:WebDropDown ID="WebDropDown1" runat="server" DataSourceID="SqlDataSource_SystemTypes" TextField="Item_Text" ValueField="Item_Value" DropDownAnimationType="Linear" DropDownContainerHeight="0px" DropDownContainerMaxHeight="0px" DropDownContainerWidth="0px" EnableDropDownAsChild="True" EnableMultipleSelection="True" MultipleSelectionType="Checkbox" PageSize="0" Width="100%"> </ig:WebDropDown>
The webDropdown is visible (aside from the dropdown arrow graphic whereever that is supposed to exist) and it is populated properly.
I can check multiple items. Looks good.
When I handle my formview_updating event to grab the selections so I can stuff them in a table, I have only the items I initially selected when the formview was databound. No items that I have checked on the form are marked as selected in the webdropdown.items or selecteditems collections.
How depressing.
Is there some way to reliably access the selected items?
Another tidbit. Looking at online documentation, the Keyboard Navigation topic for the WebDropDown tells me what keys should be working with it.
Most keys do nothing but scroll the page. I get no response from the webdropdown using Ctrl-uparrow/downarrow or any of the navigation keys when I have it open and have clicked on a selection (using the mouse).
Is there some client side or server side event I need to be handling with this thing?
BTW I'd be happy to share my desktop in a WebEx session if you'd like to see what I see.
My issue continues.
My SaveSystemTypes procedure does essentially what you suggest. The reference in the ItemUpdating event was only for me to look at the webdropdown in the debugger.
Now I have..
Protected Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles FormView1.ItemUpdating e.NewValues.Item("AgencyKey") = CType(Me.FormView1.FindControl("DropDownList_AgencyLocation"), DropDownList).SelectedValue e.NewValues.Item("Modified_By") = Session("UserName").ToString e.NewValues.Item("Modified_Date") = DateTime.Now.ToShortDateString e.NewValues.Item("AsOf") = e.NewValues.Item("Modified_Date") e.NewValues.Item("AssessmentDetailsKey") = Session("AssessmentDetailsKey").ToString e.NewValues.Item("AgencyKey") = CType(Me.FormView1.FindControl("DropDownList_AgencyLocation"), DropDownList).SelectedValue
Dim ThisWebDropDown As WebDropDown = CType(Me.FormView1.FindControl("WebDropDown1"), WebDropDown)
For Each ThisItem As DropDownItem In ThisWebDropDown.SelectedItems If ThisItem.Selected Then Debugger.Break() End If Next
End Sub
so I can see what is selected.
What I see is the items that were selected after I initially loaded the webdropdown.
Say I have seven items that are selected when the form loads. I select the items in the Formview databound event. I Click on Edit in the formview to open edit mode. I open the dropdown and see all seven items selected as expected.
Now I unselect 3 of those items and select one additional item. In the dropdown I now have 5 items selected. I can close and open the dropdown and the 5 items are still selected as expected.
Now I click Update. My formview_Updating event (above) fires. In the for loop, my ThisWebDropDown.SelectedItems count is 7! The selected items it loops through are the original 7 selected items I started with. My changes are gone.
Is there some particular key or click I have to do to make the changes in the webdropdown be saved? so far I just use the mouse to open the dropdown, select/unselect, and close the dropdown.
Further mystery - One of our remote testers today managed to save changes in the webdropdown once. Absolutely unknown what she did (naturally she can't remember). She is using IE7 which I do not have (although IE8 in compatibility mode doesn't change anything for me.
I'm getting desperate to get this working.
Right. I had tried using no updatepanel at all, using a plain AJAX updatepanel, and a WARP panel. I didn't get anywhere with any attempt.
Thanks.
Hello,
I just wanted to let you know that WebDropDown control is not compatible with WARP, i have seen somewhere in your code.