Hi,
I have a simple webDropDown with 3 items in the list. I have included an event handler for wdd_ValueChanged. In that procedure I have a debug display of the event args e.NewValue, wdd.SelectedValue, wdd.SelectedItemIndex and wdd.SelectedItemCount
PROBLEM 1: When the WDD was originally placed on the page and tested, the SelectedItemCount changed from 1 to 2 after I selected a diferent item from the drop down and the SelectedValue continued to always display the ValueField value from the item that was selected the first time. This was acting like Enable Multiple Selection flag was set to true, but it was not..
As a test, I set the Enable Multiple Selection flag to true, ran my test and then set it back to false. After "flipping" this setting, the debug display in the wdd_ValueChanged event behaved correctly.
PROBLEM 2: As I indicated, there are just 3 items in the simple webDropDown (Clients, Carriers, Licensees). When the page is initially opened, first item "Clients" is displayed. The property wdd.SelectedItemIndex is set to 0 in code. If I select "Carriers", then the wdd_ValueChanged event fires. If I then select "Licensees", the wdd_ValueChanged event fires again. Now, if I select "Clients" (the first item in the list), the event wdd_ValueChanged event does not fire.
PROBLEM 3: This does not seem to be an issue yet, but if I use Quick Watch to look at the properties of the WDD when it is constructed (list items are added in server side code) the property wdd.ValueField has the assignment for the data source column "ID". But, when I set a breakpoint in the event wdd_ValueChanged and look at the properties for the WDD, the property wdd.ValueField is an empty string.
Thanks - NormD
Hello Norm,
Let me know something. Are you assigning the data source to the webDropDown on page load. The described issue is reproducible if the DS is set on page load and it coes because after selection changed is fired the drop down is rebinded and the selected value is again the value set to be default.
Looking forward to hear from you.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://ko.infragistics.com/support
Hi Georgi,
I have tried this bothof the following ways:
a. If ( ! this.IsPostBack) { fillComboBoxes() }
b Tied to a, Object Data Source without any explicit server side code to configure the data set and web drop down list
Both approaches exhibited the same behavior. My normal design style is to use re-usable class methods to retrieve data sets and configure he web drop dows and grids. My reasons for this approach are; (a) many of the web drop downs are present on almost evey ypage of this application so using class methods to configure them gives me a single point to modify if I ned to make a global change and (b) many of the data access layer class methds can be shared with a parallel Windows Forms Application.
I tried your example using the AutoPostBackFlags setting only and it still does not work for me. However, if I use the AutoPostBackFlags ALONG WITH setting AutoPostBack = True, then my sample worked for the _ValueChanged() event.
<
ig:WebDropDown ID="wddCompanyType" runat="server" Width="200px"
>
Hi Norm,
Here I am attaching the sample modified.
What I experience is:
When I run it in debug mode and select the second item first the CalueChanged is hit after that SelectionChanged.
I selected the third item and the events are fired in the same way.
After that I went back to the first Item and again they are fired in the same way.
I tested a couple of time changing the order of the selection of the elements.
Please review the sample and let me know your comments. Correct me if I missed something.
Did you have a chance to review the sample?
If you need further assistance with this matter I will be glad to help.
Sorry that it took so long to get back to this - got in the middle of an application final Q/A release cycle with a client.
I ran the modified sample and the ValueChanged event does not fire at all. When this event fires the text for the label is updated to show what was just selected. It never changes from the value on the initial page load.
Thanks, Norm
HI Norm
This does not mean the event does not fire. Try this in debug mode. The event is fired each time.
Set the break points in the method and test it.
I hope this helps.
The text is changed on later stage after the label is rendered on the page.
Thanks Georgi,
It turns out that I had to change anothe setting for the web drop down before the text in the update panel would be updated. Yes, the event was firing. I don;t understand why the text line did not show its replacement value until the second property of the WDD was set.
Previously, for the WDD I only had the AutoPostBackFlags.SelectionChanged = Async and ValueChanged = "No"
When I also set the ValueChanged = "Yes" then the labl within the Update Panel was reliably updated on each selection change to the WDD.
I am a little confused in trying to understand that if the event is begine fired, regardless of the flag setting for ValueChanged, why the label text assignment does not get reflected when ValueChanged="No".. Any information that you can provide on this will help me better understand and use the new controls.
Otherwise, you can close this thread as resolved.
Norm