Hi,
I binding the webdropdown with sqldatasource, but when i choosed the dropdown item,can not cause
the ValueChanged event to fire.
Those are my codes.
CLIENT:
<ig:WebDropDown ID="dpEmp" runat="server" Width="200px" EnableAutoFiltering="Client" DropDownContainerHeight="300px" DataSourceID="SqlDataSource1" TextField="CN" AutoFilterQueryType="Contains" AutoFilterResultSize="100" AutoFilterTimeoutMs="2000" AutoPostBack="True" onvaluechanged="dpEmp_ValueChanged" DataKeyFields="Code" ValueField="Code" > <DropDownItemBinding TextField="CN" ValueField="Code"></DropDownItemBinding> <AutoPostBackFlags SelectionChanged="On" ValueChanged="On" /> </ig:WebDropDown>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ExpenseLineConnectionString %>" SelectCommand="SELECT Code+Name AS CN, Code FROM TCCEmp WHERE (CCEmp = @CCEmp)"> <SelectParameters> <asp:Parameter DefaultValue="E" Name="CCEmp" Type="String" /> </SelectParameters> </asp:SqlDataSource>
SERVER:
protected void dpEmp_ValueChanged(object sender, Infragistics.Web.UI.ListControls.DropDownValueChangedEventArgs e) {
}
I'm seeing exactly the same behavior. To simplify things and get away from any complications caused by my SQL data source, I created a page with nothing on it other than a simple WedDropDown with a hard coded list of items. No matter what combination of "autopostback" properties I select, neither the SelectionChanged nor ValueChanged events in the VB code behind file fire. Additionally, since I also set a breakpoint in the Page_Load event, I can see that no postback at all is taking place, let alone having those events triggered.
I found another post where Angel suggests adding a <ClientEvents /> declaration and that at least got the events to fire.
<ig:WebDropDown ID="cboSimple" ... MultipleSelectionType="Checkbox" PageSize="0"> <ClientEvents /> <AutoPostBackFlags SelectionChanged="On" /> <Items>
But there still two "minor" issues. (1) Regardless of the combination of SelectionChanged = On/Off and ValueChanged = On/Off, if either is set, both events fire if they have code. (2) The response to the users click on an item in the drop down list is very slow. It takes about 3 seconds to see a response on my system, and that's without the code doing anything other than assigning a string variable.
Thanks for your feedback. You can take a look at the following sample (it demonstrates what you are asking):
http://samples.infragistics.com/2009.1/WebFeatureBrowser/Default.aspx => on the left menu WebDropDown => Server Events.
On the other hand, if Page_load is not hit at all, then there is no postback, so neither of ValueChanged or SelectionChanged will be triggered.
You have two options:
1) set AutoPostback to On => this will make both ValueChanged and SelectionChanged AutoPostbackFlags to On
2) set AutoPostBackFlag On for ValueChanged or
3) set AutoPostBackFlag On for SelectionChanged (will also trigger the event handler for ValueChanged, if such is registered in the code behind/aspx).
Thanks,
Angel