Hello Team,
For eg. Grid1 and Grid2 have the following rows,
Grid1Row1: UnitPrice=x1Row2: UnitPrice=x2
Grid2Row1: MinWeight=y1, MaxWeight=z1Row2: MinWeight=y2, MaxWeight=z2
1. What i want is:
x = x1 + x2;x + y1 + z2 has to be 100.x+ y2 + z1 has to be 100.
Also, when i click on y1/ y2 or change the values of y1 /y2 than z2 and z1 values should change respectively as per above formula. y1 always has to be (100 - x - z1)y2 always has to be (100 - x - z2)
Similarly z1 = 100-x-y2 an z2 = 100-x-y1.
I tried below sample code but it is not giving results as expected. Let me know if there is any igx grid cell property that will provide flag when cell is highlighted or i click on that particular cell.
Sample Stackbliz: https://stackblitz.com/edit/angular-grid-add-multi-grids?file=src%2Fapp%2Fgrid%2Fgrid-allData-summary%2Fgrid-allData-summary.component.html2. Also, In Grid 2, In row1 if y1 > z1 => error msgSimilarly, if y2 > z2 => error msgAlso please provide a working sample stackbliz for point 2 ASAP.
Hello Mihoko,
Thanks..
Hello Shobhana,
For #1, I see you have asked the same question in the forum below. Please see the answer there.
https://ko.infragistics.com/community/forums/f/ignite-ui-for-angular/121800/igx-grid-sum-of-columns-of-data-type-number-for-two-different-grids-should-be-equal-to-100
For #2, if you wish to show an error message when a cell is edited, you can use igxGrid's onCellEdit event and look up the data there.
I have added the below code to your sample to show a popup message if MinWeight is greater than MaxWeight when #grid2 is edited.
public async checkSum(event) {..... if (this.resultArray2[event.cellID.rowIndex] < this.resultArray3[event.cellID.rowIndex] ) { alert("MinWeight must be smaller than MaxWeight."); }..... }
https://stackblitz.com/edit/angular-grid-add-multi-grids-szy2pa
Please reply this post ASAP. It is an ongoing project.