Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Column validation for required field

Column validation for required field

New Discussion
Shobhana Suara
Shobhana Suara asked on Jul 29, 2020 5:09 PM

Hello,

Using Igx data grid. I have a column that needs to have a required validation and dynamically toggle when the value is not empty/ greater than zero.

Please let me know how to implement the same.

Sign In to post a reply

Replies

  • 0
    Mihoko Kamiishi
    Mihoko Kamiishi answered on Jul 29, 2020 1:26 AM

    Hello Shobhana,

     

    Can you please elaborate on how you wish the cell to behave when a certain value is entered?

    • 0
      Shobhana Suara
      Shobhana Suara answered on Jul 29, 2020 6:10 AM

      Just like form control has required validation. Is there a way to validate the column is required column. If i touch the row and do not enter any value that error must display saying "please fill the Required field" and won't tab to next cell/column.

      • 0
        Mihoko Kamiishi
        Mihoko Kamiishi answered on Jul 29, 2020 9:39 AM

        Hello Shobhana,

        You should be able to handle igxGrid's onCellEdit event and see if a cell being edited is empty or not, and programmatically make the cell enter into edit mode using IgxGridCellComponent's setEditMode() method.

        In order to prevent cell navigation by Tab key, I suggest you handle a cell editor's keydown event and cancel the key action.

        In the sample below, I have added the above implementation to "Product Name" column.

        https://stackblitz.com/edit/angular-cukexw-idersu

      • 0
        Shobhana Suara
        Shobhana Suara answered on Jul 29, 2020 5:09 PM

        Thank u Mihoko. It is great help!!

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Shobhana Suara
Favorites
0
Replies
4
Created On
Jul 29, 2020
Last Post
5 years, 7 months ago

Suggested Discussions

Created by

Created on

Jul 29, 2020 5:09 PM

Last activity on

Feb 19, 2026 7:26 AM