Automatically Select Only/First Option from Cascade

2 posts, 0 answers
  1. Adam
    Adam avatar
    1 posts
    Member since:
    Dec 2014

    Posted 28 Mar Link to this post

    How I can cause the second combo box of cascading group of a combo boxes to automatically select the only item found after a user selects an item from the first combo box. While it may seem simply straight forward, it has proven quite difficult. JavaScript tricks such as select(0) or value(0) have not worked.

     

    Thank you for your help,

    Adam

  2. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    356 posts

    Posted 30 Mar Link to this post

    Hi Adam,

    The select() method of the Kendo UI ComboBox will do the trick, as long as it is invoked after all of the data items have loaded (you can handle the dataBound event):

    // ComboBox configuration
    ...
    dataBound:
    function(e){
      e.sender.select(0);
    },
    ...

    I hope this helps.

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