Hi Reda,
Thank you for using Syncfusion products.
1. You can set the cell type of table as formula using CellType property of the GridControl. Then you can set the formula to that particular cell using Text property.
2. You can get the total of column3 by assigning the that particular cell's value to the Textbox using FormattedText property of the GridControl.
3. You can handle CurrentCellKeyDown event to add new rows by pressing enter by increamenting the rowcount of the GridControl.
Below is the code snippet:
Me.GridControl1.TableStyle.CellType = GridCellTypeName.FormulaCell
Me.GridControl1(1, 3).Text = "=A1*B1"
Me.GridControl1(2, 3).Text = "=A2*B2"
Me.GridControl1(3, 3).Text = "=A3*B3"
Me.GridControl1(4, 3).Text = "=A4*B4"
Me.GridControl1(5, 3).Text = "=A5*B5"
Me.GridControl1(6, 3).Text = "=A6*B6"
Me.GridControl1(7, 3).Text = "=A7*B7"
Me.GridControl1(8, 3).Text = "=A8*B8"
Me.GridControl1(9, 3).Text = "=A9*B9"
Me.GridControl1(10, 3).Text = "=A10*B10"
Me.GridControl1(11, 3).Text = "=Sum(C1:C10)"
Me.TextBox1.Text = Me.GridControl1(11, 3).FormattedText.ToString()
Private Sub GridControl1_CurrentCellKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GridControl1.CurrentCellKeyDown
Me.GridControl1.RowCount = (Me.GridControl1.RowCount + 1)
End Sub
Please refer the sample available in the link below and let me know if it helps:
http://websamples.syncfusion.com//samples/Grid.Windows/F71390FollowUp/main.htm Regards,
Subhasheela R