ComboBox: onchange event does not fired for Numeric Values

5 posts, 0 answers
  1. Suresh Babu
    Suresh Babu avatar
    2 posts
    Member since:
    May 2009

    Posted 17 Jul 2013 Link to this post

    Hi,

    The attached sample project is based on your combo box sample post along with other elements.  

    In this project combo box onchange event does not fired if it has numeric value.  Below are details for the same.

                 1.  I have 2 combo boxes and 1 label in the attached project: Alphabet Combo, Numeric Combo and Selected Value:  Alphabet Combo has values: A-1, B-2, C-3, D-4 and Number Combo has values: 1-A, 2-B, 3-C, 4-D
                 2. Select Alphabet combo by pressing letter 'A' or 'B' or 'C' or 'D' by using keyboard, onchange event fired and selected value and selected text will show on label control  (working fine)

                 3. But I have done for Numeric Combo same as above, but it won't show selected value and selected text due to onchange event does not fired. 

    For testing, 
        -  Alphabet Combo:  Press 'A' by using keyboard and press Tab, it will show the selected value and text
        - Numberic Combo: Press '1' by using keyboard and press Tab, it wont show the selected value and text

    Code for above requirement:
    1) Alphabet Combo:
         @(Html.Kendo().ComboBox()
                          .Name("AlphabetCombo")
                          .Suggest(true)
                          .Filter("StartsWith").MinLength(0)
                          .HighlightFirst(true)
                          .Placeholder("Select fabric...")
                          .DataTextField("Text")
                          .DataValueField("Value")
                          .BindTo(new List<SelectListItem>() {
                               new SelectListItem() {
                                Text = "Select", Value = "0"   
                              },
                              new SelectListItem() {
                                Text = "A-1", Value = "1"   
                              },
                              new SelectListItem() {
                                Text = "B-2", Value = "2"   
                              },
                              new SelectListItem() {
                                Text = "C-3", Value = "3"   
                              },
                              new SelectListItem() {
                                Text = "D-4", Value = "4"   
                              }
                          })
                         .SelectedIndex(0)
                         .Events(events =>
                          {
                              events.Change("Combo_Change");
                          })
                    )

    2) Numeric Combo:
          @(Html.Kendo().ComboBox()
                                  .Name("SampleData2")
                          .Suggest(true)
                          .Filter("StartsWith").MinLength(0)
                          .HighlightFirst(true)
                          //.Placeholder("Select fabric...")
                          .DataTextField("Text")
                          .DataValueField("Value")
                          .BindTo(new List<SelectListItem>() {
                               new SelectListItem() {
                                Text = "Select", Value = "0"   
                              },
                              new SelectListItem() {
                                Text = "1-A", Value = "1"   
                              },
                              new SelectListItem() {
                                Text = "2-B", Value = "2"   
                              },
                              new SelectListItem() {
                                Text = "3-C", Value = "3"   
                              },
                              new SelectListItem() {
                                Text = "4-D", Value = "4"   
                              }
                          })
                         .SelectedIndex(0)
                         .Events(events =>
                          {
                              events.Change("Combo_Change");
                          })
                    )

    3) Label to show selected value and text
       <b>Selected Value is : </b> <label id="lblSelectedValue" runat="server"></label>

    4) OnChange Event: JavaScript code
          <script language="javascript" type="text/javascript">
            function Combo_Change(e) {
                var combo = e.sender;
                $('#lblSelectedValue').text(combo.value() + ', ' + combo.text());
            }
        </script> 

    Please help me to resolve the issue.  Thanks in advance.

    .

  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 19 Jul 2013 Link to this post

    Hi,

    I reproduced the problem you wrote about and I have logged it in our system. We will look into it and I will follow up in this thread as soon as there is more information.

    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Suresh Babu
    Suresh Babu avatar
    2 posts
    Member since:
    May 2009

    Posted 23 Jul 2013 Link to this post

    Hi Daniel,

    Thank you for look into my issue and hope you gives good solution in soon for the same.

    Thanks,
    Suresh
  5. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 26 Jul 2013 Link to this post

    Hello Suresh,

    Unfortunately, it seems that the problem is a little more complicated than we originally thought and will require further investigation. We will follow up in this thread once it has been resolved.

    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 03 Oct 2013 Link to this post

    Hello,

    I am glad to inform you that the issue is now fixed. The fix will be available in the next official release.

    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready