Hi Slava,
Thanks for your update.
We have analyzed your provided code part. If you have used the InsertRange method to add the new row for GridControl, then row count will be increased automatically. So please use the “RowCount” instead of “RowCount + 1” to set the value for new row. Please refer the below code example and attached sample,
Code example
//Row count is 25
this.checkGrid.Rows.InsertRange(this.checkGrid.RowCount +1, 1); //Now row count is 26
this.checkGrid[this.checkGrid.RowCount +1, 1].Text = item.Attribute("text").Value; //So you have tried to set the value for 27th row. But there is not presenting the 27th row in GridCotnrol
Please modify your code like below
this.checkGrid[this.checkGrid.RowCount , 1].Text = item.Attribute("text").Value;
this.checkGrid[this.checkGrid.RowCount, 2].CellValue = item.Attribute("kol").Value;
this.checkGrid[this.checkGrid.RowCount, 3].Text = item.Attribute("ed").Value;
this.checkGrid[this.checkGrid.RowCount, 4].CellValue = item.Attribute("cost").Value;
this.checkGrid[this.checkGrid.RowCount, 5].CellValue = item.Attribute("skidka").Value;
this.checkGrid[this.checkGrid.RowCount, 6].CellType = GridCellTypeName.FormulaCell; this.checkGrid[this.checkGrid.RowCount +1, 6].CellValue = "=" + "(" + item.Attribute("kol").Value + "*" + item.Attribute("cost").Value + ")" + "*" + "(" + "1" + "-" + item.Attribute("skidka").Value + ")";
Regards,
Mohanraj G