<asp:UpdatePanel runat="server" ID="uppnl1" ChildrenAsTriggers="true" UpdateMode="Conditional"> <ContentTemplate> <ig:WebDropDown ID="ddlCheck" runat="server" DataKeyFields="DPCK_ID" DataSourceID="DealerChecksODS" DropDownAnimationDuration="1200" DropDownAnimationType="EaseOut" DropDownContainerHeight="200px" DropDownContainerMaxHeight="400px" DropDownContainerWidth="270px" DropDownOrientation="Default" EnableDropDownAsChild="True" MultipleSelectionType="Checkbox" PageSize="0" TextField="DPCK_CheckNumber" ValueField="DPCK_ID" BorderStyle="Solid" BorderWidth="1px" Height="20px" Width="130px" ToolTip="Select a check for batching" AutoPostBack="true" > <Items> <ig:DropDownItem Selected="true" Value="" Text="<Choose Check>" /> </Items> <DropDownItemBinding TextField="DPCK_CheckNumber" ValueField="DPCK_ID" /> <HeaderTemplate> <div class="dealerCheckhdr">Deposit Checks</div> </HeaderTemplate> <ItemTemplate> <span class="dealerCheckttl"><%#DataBinder.Eval(Container.DataItem, "DPCK_CheckNumber")%></span>: <%#String.Format("{0:c}", DataBinder.Eval(Container.DataItem, "DPCK_CheckAmount"))%> </ItemTemplate> <AutoPostBackFlags SelectionChanged="On" ValueChanged="On" /> </ig:WebDropDown> </ContentTemplate> </asp:UpdatePanel>
Code Behind
Private Sub WireEvents() AddHandler ddlCheck.SelectionChanged, AddressOf ddlCheck_SelectionChanged AddHandler ddlCheck.ValueChanged, AddressOf ddlCheck_ValueChanged End Sub
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init WireEvents() End Sub
Protected Sub ddlCheck_SelectionChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs) Dim i As Integer = 5 End Sub Protected Sub ddlCheck_ValueChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.ListControls.DropDownValueChangedEventArgs) Dim i As Integer = 5 End Sub
I put break points on the Int=5 lines and neither of them are hit at any time no matter what. I followed the example on the samples site for ServerEvents and still nothing. Also one other thing,
<ig:DropDownItem Selected="true" Value="" Text="<Choose Check>" /> does not show up in the drop down. I would like this to be the initially selected item. This item should not be in the template when you actually click the drop down to open it. I tried tapping into DataBound event
Public Sub ChecksDataBound(ByVal sender As Object, ByVal e As EventArgs) 'ddlCheck.Items.Insert(0, New DropDownItem("<Choose Check>")) End Sub
That add the item the way I like, except that it ALSO creates a blank template item which is definitely not what I want. Any help is always appreciated.
Code On,
~ck
Hi,
Could you upgrade to the latest service release? Or if you still want to use the volume release (build number 1015), set AutoPostBack=false, and in <AutoPostBackFlags> set ValueChanged=On
Thanks,
Angel
I am using
Version=9.1.20091.1015
It does not fire the event.
With this code, all of these events are fired correctly for me. Using build number 9.1.2087.
Here is the full code (you can just paste it in code behind and it should work):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Infragistics.Web.UI.ListControls;
public partial class Default2 : System.Web.UI.Page
{
public class Item
private string _value, _meaning, _url;
public string Meaning
get
return this._meaning;
}
set
this._meaning = value;
public string Value
return this._value;
this._value = value;
public string Url
return this._url;
this._url = value;
List<Item> list1 = new List<Item>();
protected void Page_Init(object sender, EventArgs e)
Item i1 = new Item();
i1.Meaning = "meaning 1";
i1.Value = "value 1";
Item i2 = new Item();
i2.Meaning = "meaning 2";
i2.Value = "value 2";
Item i3 = new Item();
i3.Meaning = "meaning 3";
i3.Value = "value 3";
list1.Add(i1);
list1.Add(i2);
list1.Add(i3);
WebDropDown c = new WebDropDown();
c.EnableClosingDropDownOnSelect = false;
c.DisplayMode = DropDownDisplayMode.DropDownList;
c.Width = new Unit(300);
c.AutoPostBack = false;
c.EnableCachingOnClient = false;
c.EnableAutoFiltering = Infragistics.Web.UI.ListControls.AutoFiltering.Server;
c.EnableLoadOnDemand = true;
c.DropDownContainerMaxHeight = new Unit(100, UnitType.Pixel);
c.PageSize = 12;
c.ID = "WebDropDown1";
c.EnableViewState = true;
c.EnableAutoCompleteFirstMatch = false;
c.EnableDropDownAsChild = true;
c.AutoPostBackFlags.ValueChanged = Infragistics.Web.UI.AutoPostBackFlag.On;
c.SelectionChanged += new DropDownSelectionChangedEventHandler(c_SelectionChanged);
c.ValueChanged += new DropDownValueChangedEventHandler(c_ValueChanged);
c.DataSource = list1;
c.TextField = "Meaning";
c.ValueField = "Value";
c.DataBind();
Page.Form.Controls.Add(c);
void c_ValueChanged(object sender, DropDownValueChangedEventArgs e)
Response.Write("hey");
void c_SelectionChanged(object sender, DropDownSelectionChangedEventArgs e)
Hello
I am creating Web dropdown dynamically. It does not fire the selectionchanged or value changes event.
Here is my code. Please help me out.
WebDropDown
();
)
c.MultipleSelectionType =
.Checkbox;
c.EnableMultipleSelection =
;
c.EnableClosingDropDownOnSelect =
c.DisplayMode =
.DropDownList;
c.Width =
(300);
c.AutoPostBack =
c.EnableCachingOnClient =
c.EnableAutoFiltering = Infragistics.Web.UI.ListControls.
.Server;
c.EnableLoadOnDemand =
c.DropDownContainerMaxHeight=
.Pixel);
c.ID = _currentParameter.ParaName;
c.EnableViewState =
c.EnableAutoCompleteFirstMatch =
c.EnableDropDownAsChild =
c.AutoPostBackFlags.ValueChanged = Infragistics.Web.UI.
.On;
c.SelectionChanged +=
(c_SelectionChanged);
c.ValueChanged +=
(c_ValueChanged);
c.TextField =
c.ValueField =
box.Controls.Add(c);
e)
Response.Write(
);
I had the same problem. What I found out is that I forgot to add the following to the webdropdown:
<clientevents />
This solved it for me.
Goodluck
Jeroen