-
Hi, In my igx-grid there are some editable fields & I want to restrict user from entering more than 7 characters in that respective field. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @kevalgw, Yes, there exist multiple approaches to restrict the cell’s text length.
The above mask specifies an input sequence of seven arbitrary keyboard characters. This restricts the length to 7 and provides prompt chars in addition. For other field types, such as number, a possible approach would be to again create a custom cell editing template with the
And execute custom logic disallowing to type more than X characters, for instance:
Please, note that passing the Here you can find a sample demonstrating both approaches for the “ProductName” string field and for the “Price” number field. |
Beta Was this translation helpful? Give feedback.
Hi @kevalgw,
Yes, there exist multiple approaches to restrict the cell’s text length.
For example, for a text field, one option would be to leverage the
igxMask
directive, about which you could read more in our documentation here.An IgxInputGroup having the
igxMask
directive could be placed in the target field’s cell editing template as follows: