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
close icon

Setting CellValue for entire column of FormulaCell type

I am able to set a specific column as FormulaCell type in a GridGroupingControl 


            gridGroupingControl1.TableDescriptor.Columns["HEADERNAME"].Appearance.RecordFieldCell.CellType = GridCellTypeName.FormulaCell;

But this code does not do anything

            gridGroupingControl1.TableDescriptor.Columns["HEADERNAME"].Appearance.RecordFieldCell.CellValue = "=SUM(A0,B0)";

Is there any way to assign a formula to an entire column without using an event handler or iterating through each row?

When I set the DataSource to a DataTable I want to just be able to set  some of the columns as Formula columns and the formula is the same for the entire column that refers to other columns.



1 Reply

NK Neelakandan Kannan Syncfusion Team July 29, 2015 04:37 AM UTC

Hi Jeff,

Thank you for using Syncfusion products.

If you want to calculate the values based on other fields in same record, you can use ExpressionFieldDescriptor class to define the expressions for whole column instead of using Formula cells. We have provided the Dashboard sample regarding ExpressionField. So that please make use of below UG link and sample,

UG link:
http://help.syncfusion.com/ug/windows%20forms/Documents/expressionfields.htm
http://help.syncfusion.com/ug/windows%20forms/Documents/howtoaddexpressioncolumns.htm
http://help.syncfusion.com/ug/windows%20forms/Documents/howtoaddexpressionfields.htm

Dashboard sample:
<Install Location>\Syncfusion\EssentialStudio\[Version Number]\Windows\Grid.Grouping.Windows\Samples\Filters and Expressions\Expression Field Demo

Please let me know if you have any queries.

Regards,
Neelakandan

Loader.
Live Chat Icon For mobile
Up arrow icon