I’m using an ISWebCombo dropdown control in my ASP.NET Web Forms application. The dropdown does not close automatically when I select a value. I need it to close after selection.
<ISWebCombo:WebCombo ID="dbApplication" DataTextField="DbComboText" DataValueField="DbComboValue"
runat="server" AllowAutoPostback="True" DataSourceID="ObjectDataSource1" Height="20px" OnValueChanged="dbApplication_ValueChanged"
UseDefaultStyle="True" Width="185px">
<LayoutSettings EntryMode="AutoComplete" AlwaysShowHelpButton="False">
</LayoutSettings>
</ISWebCombo:WebCombo>
The AllowAutoPostback property is set to True because I need to trigger the dbApplication_ValueChanged event on the server-side. Here is the relevant code-behind:
protected void dbApplication_ValueChanged(object sender, EventArgs e)
{
dgUser.CurrentPageIndex = 0;
BindApp();
}
However, with AllowAutoPostback=”True”, the dropdown does not close automatically after a value is selected. It only closes when I set AllowAutoPostback to False, but this prevents the dbApplication_ValueChanged event from firing.
I tried using JavaScript with onclientselectedindexchanged or onclientselectedvaluechanged events, but they didn’t seem to work.
Question: How can I close the ISWebCombo dropdown after selecting a value while keeping AllowAutoPostback enabled and ensuring the dbApplication_ValueChanged event is triggered?
Any suggestions or solutions would be greatly appreciated!
How to Close ISWebCombo Dropdown After Selecting a Value with AutoPostback Enabled?