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

Formatting Expression Columns display

Thread ID:

Created:

Updated:

Platform:

Replies:

21717 Nov 17,2004 11:59 PM UTC Nov 18,2004 11:50 AM UTC WinForms 1
loading
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 %";

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.

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

;