Hello,
I'm trying to achieve the following: if the selection of the drop down has not changed, do not postBack. if the selection has changed, do postBack. How would I achieve this? I tried to change OnClientDropDownClosing to OnClientSelectedIndexChanged but the OnClientSelectedIndexChanged event was not fired.
I'm using version 2009.2.701.35. My sample code is as below. Thanks for your help!
Thanks,
Ashley
I'm trying to achieve the following: if the selection of the drop down has not changed, do not postBack. if the selection has changed, do postBack. How would I achieve this? I tried to change OnClientDropDownClosing to OnClientSelectedIndexChanged but the OnClientSelectedIndexChanged event was not fired.
I'm using version 2009.2.701.35. My sample code is as below. Thanks for your help!
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Untitled Page</title> |
| <style type="text/css"> |
| .Hidden |
| { |
| visibility: hidden; |
| } |
| </style> |
| </head> |
| <body> |
| <script type="text/javascript"> |
| function checkboxClick(e) |
| { |
| e.cancelBubble = true; |
| if (e.stopPropagation) |
| { |
| e.stopPropagation(); |
| } |
| } |
| function OnClientDropDownClosing(sender) |
| { |
| document.getElementById(sender.get_id() + "Helper").click(); |
| } |
| </script> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server" /> |
| <div> |
| <telerik:RadComboBox runat="server" ID="RadComboBox1" Height="200" HighlightTemplatedItems="true" |
| AutoPostBack="false" AllowCustomText="true" Text="All"> |
| <Items> |
| <telerik:RadComboBoxItem Text="One" /> |
| <telerik:RadComboBoxItem Text="Two" /> |
| <telerik:RadComboBoxItem Text="Three" /> |
| </Items> |
| <ItemTemplate> |
| <div> |
| <asp:CheckBox onclick="checkboxClick(event);" runat="server" ID="CheckBox" Text="" /> |
| <%# DataBinder.Eval(Container, "Text") %> |
| </div> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| <asp:Button ID="RadComboBox1Helper" runat="server" Text="" CssClass="Hidden" OnClick="ButtonHelper_Click" /> |
| </div> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Web.UI; |
| public partial class _Default : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!IsPostBack) |
| { |
| RadComboBox1.DataBind(); |
| RadComboBox1.OnClientDropDownClosing = "OnClientDropDownClosing"; |
| //RadComboBox1.OnClientSelectedIndexChanging = "OnClientDropDownClosing"; |
| } |
| Page.Title = "new title"; |
| } |
| #region DropDown Closed Events |
| protected void ButtonHelper_Click(object sender, EventArgs e) |
| { |
| RadComboBox1.Text = "13"; |
| } |
| #endregion |
| } |
Thanks,
Ashley