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

Maxlength attribute of every cell

3 Answers 276 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 20 Jul 2018, 03:42 PM

Is there any way to set a maxlength attribute on the input of every cell. I was hoping I could accomplish this with out using validation.

 

Thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 24 Jul 2018, 12:37 PM
Hi Trevor,

The content of each cell in the Spreadsheet is kept into a div element, so adding MaxLength attribute is not an option. A possible approach you can use, though, is to attach a handler to the change event of the control and check manually the length of the new value, cancelling the event should it exceed the target max length.

For example: http://dojo.telerik.com/imIBaTIn

You can also consider using a range validator. You can see a sample where such is used here:
https://demos.telerik.com/kendo-ui/numerictextbox/validation

Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Trevor
Top achievements
Rank 1
answered on 26 Jul 2018, 02:48 PM
Awesome! Thanks for the reply!
0
Vessy
Telerik team
answered on 30 Jul 2018, 11:01 AM
Hi,

You are welcome, Trevor :) Do let us know should any further question related to our controls occur.

Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Spreadsheet
Asked by
Trevor
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Trevor
Top achievements
Rank 1
Share this question
or