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.
Hello Shobhana,
Can you please elaborate on how you wish the cell to behave when a certain value is entered?
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.
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
Thank u Mihoko. It is great help!!