We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem with formulas

I''m having a small problem using formulas with GridControl. In my project I have a GridControl which is not bounded to any datasource. In that grid I have 22 columns which 5 of them are readonly and are formula oriented. but when I do insert a formula in that column : Me.gridModel.ColStyles(17).Text = "= A2 + 10" all rows in that column stay with the same value. I would like the row 3 to have the formula "= A3 + 10"; row 4 with "= A4 + 10" How can I do this?

1 Reply

AD Administrator Syncfusion Team September 2, 2004 12:49 PM UTC

Currently, you have to loop through the cells in the column, and format the string appropriately.
for(int row = 1; <= grid.RowCount; ++row)
     grid[row, 17].Text = string.Format("= A{0} + 3", row);
In the next release (do not know when - if you want a private build, you can submit a Direct Trac incident and request one), there will be a convention if you would use row 0 in a formula, it will be treated as a wild card that can be used to enter the formula into the grid.ColStyles as you tried above. In that case, the grid will swap out the zero for current row as it parses the expression.

Live Chat Icon For mobile
Up arrow icon