This is a migrated thread and some comments may be shown as answers.

Masked text inside a combobox

3 Answers 240 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Raja
Top achievements
Rank 1
Raja asked on 24 Jul 2014, 09:33 PM
Hi ,

I would like to have masked text inside combobox. For example value from my database will be A22345. This will appear as user starts typing. But I would like it to be displayed as A2-2345 in the combobox. How can I achieve this?

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 25 Jul 2014, 11:19 AM
Hello Raja,

Kendo ComboBox widget is not designed to be combined with Kendo MaskedTextBox widget. The only feasible  approach I can suggest you is to convert the data from "A22345" to "A2-2345" manually and then bind the widget.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Raja
Top achievements
Rank 1
answered on 28 Jul 2014, 05:56 PM
Hi,
Thanks for the response.

How can I handle keyup event for the combobox? I am thinking of storing the formatted values in the database. So once the user enters two characters i will append "-" as the third character.

Thanks,
Raja
0
Georgi Krustev
Telerik team
answered on 29 Jul 2014, 09:11 AM
Hello Raja,

You can wire the keyup event of the visible input element and modify its value. Please note, however, that if the value of the input cannot be found in the data source then it will be considered as a custom one and widget's value and text will be set to it. In other words if "A22345" value is selected and then modified on keyup to "A2-2345" widget will think that this is a custom value and its value and text will be set to "A2-2345", which I believe will be undesired behavior.

The only feasible approach I can suggest is to modify the data items in the data source before binding the widget.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ComboBox
Asked by
Raja
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Raja
Top achievements
Rank 1
Share this question
or