Hello,
I am using build number 9.1.2087. Here is my sample code:
<ig:WebDropDown ID="WebDropDown1" runat="server" DropDownAnimationType="Linear" TextField="Keyword_Description" ValueField="Keyword_Description" EnableAutoFiltering ="Server" DropDownContainerHeight="150px" DropDownContainerMaxHeight="0px" EnableAutoCompleteFirstMatch ="False" DropDownContainerWidth="200px" LoadingItemsMessageText="Loading" AutoPostBackFlags-SelectionChanged="On" EnableLoadOnDemand="True" Width="200px" EnableClosingDropDownOnSelect="true" EnableCustomValues="false" EnableDropDownAsChild="True" MultipleSelectionType="Checkbox" PageSize="20" EnableTheming="True" StyleSetName="Office2007Blue">
<HeaderTemplate>
<table style="width: 100%; height:40px; background-color:#507DA6; color:White; font-size:20px; font-weight:bold;" cellspacing="0" cellpadding="4">
</tr></table>
<ItemTemplate>
</ig:WebDropDown>
On a server side code I need to access Keyword_ID. How can I get access to all the columns in the drop down list?
Also, I need to do some logic only after the final value is selected or typed in. What event can I put my code in.
I tried WebDropDown1_SelectionChanged and WebDropDown1_ValueChanged but these fire everytime user types something in. I need to fire this event only after user clicks on the item or the full match is found and selected.
How can I do this?
Hi,
You can try setting AutoSelectOnMatch=false. We introduced this property recently, and it won't fire selection every time you type something and there is more than 1 match. Also if you have ValueChanged postback flag set, it is the expected behavior to have the event fired every time you type something, hence you will get postback every time you type something. For this I advise to just have postback for SelectionChanged event (ValueChanged will still fire on the server).
Hope it helps,
Angel
Great. Thank you. That did work.
How about the second part to my question? How can I access items in my ItemsTemplate?
Martin
You can use the ItemBound server-side event, and there from the DropDownItem object access its DataItem property, which will contain all columns and values , i.e. Keyword_ID. to access that it depends what type is your DataItem, maybe DataRow or some custom class.
protected void WebDropDown1_ItemBound(object sender, Infragistics.Web.UI.ListControls.DropDownItemBoundEventArgs e)
{
Infragistics.Web.UI.ListControls.DropDownItem item = e.Value as Infragistics.Web.UI.ListControls.DropDownItem;
object dataItem = item.DataItem;
// see what type is the DataItem, and get the exact cell value
}
My Page Post-Backs every time I Dropdown Value Change, Following is my demo code i am using:
<td> <ig:WebDropDown ID="Dropdown1" runat="server" Width="45px" AutoSelectOnMatch="false" AutoFilterQueryType="Contains" EnableAutoFiltering="Client" DropDownContainerHeight="195px" DropDownContainerWidth="43px" EditorID="igtxtCaptureLimit" AutoPostBack="false"> <AutoPostBackFlags SelectionChanged="Off" ValueChanged="Off" />
</ig:WebDropDown> <ig:WebNumericEditor ID="TxtNumericEditor1" runat="server" MaxLength="3" MaxValue="500" MinValue="10" DataMode="Int" HorizontalAlign="Left" Buttons-ButtonPressedCssClass="ui-widget" Nullable="false" CausesValidation="false" >
<AutoPostBackFlags CustomButtonClick="Off" EnterKeyDown="Off" ValueChanged="Off" />
</ig:WebNumericEditor> </td>