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

Formatting Expression Columns display

Thread ID:





21717 Nov 17,2004 11:59 PM UTC Nov 18,2004 11:50 AM UTC WinForms 1
Tags: GridControl
Colin Marsh
Asked On November 17, 2004 11:59 PM UTC

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 11:50 AM UTC

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.

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