Hello,
Scenario: While editing igx-data grid, on click of Add button it adds 1 row to the grid.
Expected: On click of Add button, it should add 2 rows at once to the grid.
Sample Stackbliz : https://stackblitz.com/edit/angular-ignite-add-multi-rows
Please help to achieve the same ASAP as i am in an ongoing project!!
Hello Shobhana,
I looked into your sample to see addRow() method in grid-editing-sample.component.ts calls IgxGridComponent’s addRow() only one time.
You will need to call the method as many times as the number of rows you wish to add.
I have created a new sample that demonstrates how to add multiple rows on a button click event as I could not run your stackblitz sample due to some errors.
3554.igxGrid.zip
Hello Mihoko, Appreciate your help and it works !! Thanks a lot.I tried as per your suggestion. It adds 2 rows but is there a way to auto Save the added rows or edited rows? Also I have a method to validate the added rows and i use the below line of code
Hi Mihoko,
Please find the Sample: https://stackblitz.com/edit/angular-grid-edit?file=src%2Fapp%2Fgrid%2Fgrid-editing-sample%2Fgrid-editing-sample.component.ts
So while editing, the validateProduct() method is called. That's when issue arises. While adding i add 2 rows but when i edit the first row the validateProduct() method is called and it removes another row from the grid.
Hope this sample helps to understand the issue i am facing.
Still it does not fulfill my requirement. When i edit one of the row, both rows get the same value. Actually i am creating stackbliz sample but it giving me some error. Also i am not able to run your sample in my machine.
Sample Stackbliz: https://stackblitz.com/edit/angular-grid-add-multi-rows?file=src%2Fapp%2Fgrid%2Fgrid-allData-summary%2Fgrid-allData-summary.component.ts
Scenario: Using a Igx data grid. On click of add button, 2 rows are added to the grid with initial 0 values for the datatype number.when i click on cell edit on row 1 -> i can change to required number and it should be saved in the grid for row 1.Similarly, i will be able to edit row 2 and change the values and save to grid.
Thank you Mihoko.. it worked. Really appreciate your help.