Skip to content

Editing Validation in igx-grid #12154

Answered by ddaribo
kevalgw asked this question in Q&A
Discussion options

You must be logged in to vote

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:

<igx-column
    field="ProductName"
    header="Product Name"
    dataType="string"
    [editable]="true">
    <ng-template igxCellEditor let-cell="cell" let-value>
      <igx-input-group>
        <input
          igxInput
          type="text"
          [igxMask]="'CCCCCCC'"
          [igxTextSelection]="true"
          [igxFocus]="true"
       …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kevalgw
Comment options

Answer selected by kevalgw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants