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.

Formatting Expression Columns display

Thread ID:





21717 Nov 17,2004 06:59 PM Nov 18,2004 06:50 AM Windows Forms 1
Tags: GridControl
Colin Marsh
Asked On November 17, 2004 06:59 PM

I am using a groupinggridcontrol. and would like to display an expression column as a percentage display. Regular columns from my datasource I can set the format of the column using the following: MyGrid.TableDescriptor.Columns[5].Appearance.AnyCell.Format = "#0 %"; However this does not work for columns created using Expressionfields e.g. ExpressionFieldDescriptor avgTps = new ExpressionFieldDescriptor( "Average TPS", "[Total TPS] / [TPS Counter]" ); mSummaryGrid.TableDescriptor.ExpressionFields.Add( avgTps ); So how do I set the format attribute for this column

Administrator [Syncfusion]
Replied On November 18, 2004 06:50 AM

Try specifying the ResultType on the ExpressionFieldDescriptor. this.gridGroupingControl1.TableDescriptor.ExpressionFields.Add("sum"); ExpressionFieldDescriptor fd = this.gridGroupingControl1.TableDescriptor.ExpressionFields["sum"]; fd.ResultType = "System.Double"; fd.Expression = "[Col2] + [Col3]"; this.gridGroupingControl1.TableDescriptor.Columns["sum"].Appearance.AnyCell.Format = "#0.00 %";


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.