This is a migrated thread and some comments may be shown as answers.

Detecting a Formula Value change

1 Answer 86 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Rod
Top achievements
Rank 1
Rod asked on 19 Aug 2014, 01:10 PM
How can one detect when the value of a formula has changed within the radspreadsheet control?

I have a cell that is a formula  ="Anothercell*4"

I have the spreadsheet.ActiveWorksheet.Cells.CellPropertyChanged event wired,

BUT the cellPropertyChangedEvent only fires ONCE when the "anothercell" cell is changed (property = 'CellValue')

Shouldn't the event fire twice?  Once for AnotherCell and again for the formula cell (with a e.Property value of something other than CellValue?

thanks

1 Answer, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 20 Aug 2014, 02:34 PM
Hello,

The CellPropertyChanged event is raised only when some value in the data structures holding all spreadsheet values changes. When you modify a value in a cell that is referred by a formula actually the data stored in the cell holding the formula stays unmodified. Only the result value of the formula is invalidated and is calculated the next time the result value is accessed. That is why CellPropertyChanged event is not raised for the cell containing the formula.

I have attached a sample project showing how to track if a CellFormulaValue is invalidated.

I hope this helps. If you have any further questions, please do not hesitate to contact us again.

Regards,
Nikolay Demirev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Spreadsheet
Asked by
Rod
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Share this question
or