How to format comboBox values?

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    19 posts
    Member since:
    Jun 2012

    Posted 14 Feb 2013 Link to this post

    Is there way to format the values and input field of the ComboBox widget?

    Essentially I'd like a merged combobox/numeric textbox...
  2. Alexander Valchev
    Alexander Valchev avatar
    2887 posts

    Posted 18 Feb 2013 Link to this post

    Hello Alexander,

    ComboBox widget does not support formatting out of the box. If you want to achieve such behaviour you may hook up to the change event of the ComboBox and format the value manually. As an example:
    <input id="combo" />
            change: function (e) {
                var value = parseFloat(this.value()); //parse value
                if(!isNaN(value)) { //if is number
                    value = kendo.format("{0:n2}", value); //format it
                    this.value(value); //set it as a value
                } else {
                    this.value(""); //clear the value

    I hope this information will help.

    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top