Not able to use mouse to select from combo

2 posts, 0 answers
  1. sam varg
    sam varg avatar
    20 posts
    Member since:
    Feb 2010

    Posted 23 Sep 2010 Link to this post


    I am using the RadXmlHttpPanel to load a dropdown based on teh value of other dropdown. Below is my case.

    I have a state comobo. when user select a value then the county dropdown should list the counties for that state. Both State and County is coming from the DB.

    I have the county dropdown in the RadXmlHttpPanel.
    My problem is. When the choose the state dropdown for the first time I am seeing the counties populated correctly and I am able to choose from the county list.
    But then when I try to change the state then I am not able to do with the mouse. The list of state show in the dropdown but not able to choose from the list. But I am able to use the key board and select and the county dropdown populates accordingly.

    Here is the code I am using.

    <telerik:RadComboBox ID="cmbState" runat="server" Width="50px" 
        OnClientSelectedIndexChanged="ComboChanged">                                   
    </telerik:RadComboBox>
                                      
                                      
    <telerik:RadXmlHttpPanel ID="CountyXmlHttpPanel" runat="server" 
        OnServiceRequest="CountyXmlHttpPanel_ServiceRequest" EnableClientScriptEvaluation ="true">
        <telerik:RadComboBox ID="cmbCounty" runat="server" 
            Width="100px" DropDownWidth="250px" >
        </telerik:RadComboBox>
    </telerik:RadXmlHttpPanel>      
      
      
    function ComboChanged(sender, args) {
        var foundPanel = $find("<%=CountyXmlHttpPanel.ClientID %>");
        var stateCombo = $find("<%= cmbState.ClientID %>");
        var stateVal = stateCombo.get_value();
        foundPanel.set_value(stateVal);
    }
      
      
     protected void CountyXmlHttpPanel_ServiceRequest(object sender, Telerik.Web.UI.RadXmlHttpPanelEventArgs e)
            {
                //Bind county here
            }

     

    Thanks

     

  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 24 Sep 2010 Link to this post

    Hello Sam,

    I tested the code you provided locally, and I didn't experience any problems. Here is the full source code:

    .aspx
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <title></title>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function SetValue()
                {
                    var panel = $find("<%=XmlPanel1.ClientID %>");
                    panel.set_value("Bind ComboBox");
                }
            </script>
        </telerik:RadScriptBlock>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="100px" DropDownWidth="250px">
            <Items>
                <telerik:RadComboBoxItem Text="State1" />
                <telerik:RadComboBoxItem Text="State2" />
                <telerik:RadComboBoxItem Text="State3" />
                <telerik:RadComboBoxItem Text="State4" />
            </Items>
        </telerik:RadComboBox>
        <div>
            <input value="Set Value" onclick="SetValue(); return false;" type="button" />
            <telerik:RadXmlHttpPanel ID="XmlPanel1" runat="server" OnServiceRequest="XmlPanel1_ServiceRequest"
                EnableClientScriptEvaluation="true">
                <telerik:RadComboBox ID="cmbCounty" runat="server" Width="100px" DropDownWidth="250px">
                </telerik:RadComboBox>
            </telerik:RadXmlHttpPanel>
        </div>
        </form>
    </body>
    </html>

    .cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.Script.Serialization;
     
    public partial class Default_Callback : System.Web.UI.Page
    {
        protected void XmlPanel1_ServiceRequest(object sender, Telerik.Web.UI.RadXmlHttpPanelEventArgs e)
        {
            cmbCounty.DataSource = new string[] { "ComboItem 1", "ComboItem 2", "ComboItem 3", "ComboItem 4" };
            cmbCounty.DataBind();
        }
    }


    Please note that you should take into consideration the known issues of the RadXmlHttpPanel control, described in our online help.

    Kind regards,
    Pero
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top