Hi,
I would like to implement StayOpenComboBox without using templates. I followed the sample project, but it doesn't work. Here is what I have:
| var allowClose = false; | |
| function OnClientDropDownClosing(combobox) | |
| { | |
| if(allowClose == true) | |
| { | |
| allowClose = false; | |
| return true; | |
| } | |
| else | |
| { | |
| return false; | |
| } | |
| } | |
| function allowCBClose(allow) | |
| { | |
| allowClose = allow; | |
| } |
| <telerik:RadComboBox ID="RadComboBox1" Height="200px" ShowToggleImage="true" AllowCustomText="true" RadComboBoxImagePosition="Right" AutoPostBack="true" OnSelectedIndexChanged="OnComboSelectedChange" OnClientDropDownClosing="OnClientDropDownClosing" Runat="server" > |
|
| <CollapseAnimation Type="OutQuint" Duration="200"> </CollapseAnimation> |
|
| </telerik:RadComboBox> |
| protected void Page_Load(object sender, EventArgs e) | |
| { | |
| if (!IsPostBack) | |
| { | |
| RadComboBoxItem a = new RadComboBoxItem("RadComboBoxItem4", "4"); |
|
| a.Attributes["onclick"] = "allowCBClose(false);"; | |
| RadComboBox1.Items.Add(a); | |
| a = new RadComboBoxItem("RadComboBoxItem5", "5"); | |
| a.Attributes["onclick"] = "allowCBClose(false);"; | |
| RadComboBox1.Items.Add(a); | |
| } | |
| } |
As far as I can tell, allowCBClose() was called when items were clicked. However, the combobox still close after clicking. Thanks,
Peichung