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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Formula in a Grid

Thread ID:





25678 Mar 3,2005 03:49 PM UTC Mar 3,2005 06:47 PM UTC WinForms 1
Tags: GridControl
Purnaram Kodavatiganti
Asked On March 3, 2005 03:49 PM UTC

Hi, We are trying to implement a calculator type functionality with in a databoundgrid. We have a double column and all we wanted to is too add or subtract within the cell itsself. we need not hold the formula in the cell for future refernce. example we have A = 10 in a cell we want to make A= 10+20 within the cell. we want to psot 10+20 value as it is an calculate the new value and update the cell. we are doing some accounting table and wanted to have a inplace update with + and - signs within cells. any help in resolving this matter is appreciated. Thanking all, Purnaram.K

Administrator [Syncfusion]
Replied On March 3, 2005 06:47 PM UTC

So, you want to have a GridDataBoundGrid where if your user enters 10+20 in a cell, the cells shows 30 and 30 is saved into the datasource of the grid. I think the simplest way to do this is to use Essential Calculate. You can create a CalcQuick object. this.calculator = new Syncfusion.Calculate.CalcQuick(); Then handle the CurrentCellValidating event.
private void gridDataBoundGrid1_CurrentCellValidating(object sender, CancelEventArgs e)
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	cc.Renderer.Control.Text = calculator.ParseAndCompute(cc.Renderer.ControlText);


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