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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Saving the result of a formula...

Thread ID:





22888 Dec 28,2004 03:17 PM UTC Dec 29,2004 06:54 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On December 28, 2004 03:17 PM UTC

(Using v2.1.0.9) I have non-databound, non-virtual grid. When the user edits a number in cell A1, I want to capture the result of the formula in cell A2. The formula in A2 *is* recalculating, and displays the correct value; however, I do not know what event to use to persist calculated value to the database. Based on some old forum posts, it seemed like SaveCellInfo would be the ticket. I used something like: AddHandler Me.GridControl1.SaveCellInfo, AddressOf Me.GridControl1_SaveCellInfo However, this event does not seem to fire when the value in A2 is recalculated. (When I test the grid, I can see the new value displayed, but my SaveCellInfo does not get fired). Please tell me what am I doing wrong??! Thanks, s.s.

Administrator [Syncfusion]
Replied On December 29, 2004 06:54 AM UTC

This code works for me to show the changes in the output window if I drop a GridControl on the form and add these handlers.
Private Sub Form1_Load(sender As Object, e As System.EventArgs)
   Me.gridControl1.TableStyle.CellType = "FormulaCell"
   Me.gridControl1(1, 1).Text = "4"
   Me.gridControl1(1, 2).Text = "= A1 * 2"
   AddHandler Me.gridControl1.SaveCellInfo, AddressOf grid_SaveCellInfo
End Sub ''Form1_Load

Private Sub grid_SaveCellInfo(sender As Object, e As GridSaveCellInfoEventArgs)
   If Not (e.Style.FormulaTag Is Nothing) Then
      Console.WriteLine("compute value at ({0},{1}) = {2}", e.RowIndex, e.ColIndex, e.Style.FormulaTag.Text)
   End If
End Sub ''grid_SaveCellInfo


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon