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

Formula in a Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

25678 Mar 3,2005 10:49 AM Mar 3,2005 01:47 PM Windows Forms 1
loading
Tags: GridControl
Purnaram Kodavatiganti
Asked On March 3, 2005 10:49 AM

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 01:47 PM

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);
}

CONFIRMATION

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.

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.

;