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 Cells fail in multiple UI threads environment

Thread ID:





46691 Jul 18,2006 08:16 PM UTC Jul 19,2006 05:00 PM UTC WinForms 2
Tags: GridControl
Umesh Mahajan
Asked On July 18, 2006 08:16 PM UTC

We are using formula cells in our virtual grid and are having issues with the formula engine. We have a multiple GUI threads environment to maximize the performance on a multi-CPU machine. Each business component hosts a grid and gets created in a separate UI thread, with its own message pump using Application.Run(). The calculated formulas work only in the first grid. All subsequent grids start giving errors, such as "Invalid expression", even to the simplest formulas like "=123.45" (though "=123" seems to work fine). If you run all the grids in the same UI thread, there are no issues. Is this a known problem ? Any workaround possible ? We are using version. I have attached a modified version of sample application FormulaValueTest_2003 that exhibits this problem. Thanks.


Administrator [Syncfusion]
Replied On July 18, 2006 10:28 PM UTC

Thanks for the sample. There are some ThreadStatic fields in the engine code that are not being initialized in the 2nd occurrences of the engine class. You can avoid this problem by making sure these static members are explicitly initialized in your code. Below show 2 added lines to the Form_Load code in your sample. private void Form1_Load(object sender, System.EventArgs e) { this.gridAwareTextBox1.BackColor = Color.FromArgb(237, 240, 246); this.gridAwareTextBox1.WireGrid(this.gridControl1); this.gridControl1.TableStyle.CellType = "FormulaCell"; this.gridControl1.RowCount = 1100; SetFormatFirstRow(); GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine; //these 2 lines added GridFormulaEngine.ParseArgumentSeparator = '',''; GridFormulaEngine.ParseDecimalSeparator = ''.'';

Umesh Mahajan
Replied On July 19, 2006 05:00 PM UTC


Thanks for your quick answer. It works fine now.

- Umesh


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