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

Expression Column in GridGroupingControl

Thread ID:





116102 Apr 2,2014 06:46 PM UTC Apr 3,2014 06:19 AM UTC ASP.NET Web Forms (Classic) 2
Tags: GridGroupingControl
Alex Segal
Asked On April 2, 2014 06:46 PM UTC

Currently my dataTable for the mapped column returns a double. My implementation is roughly as follows:
efd.Expression = "[Score]*100";
efd.Name = "ScorePercent";

I get values like 98.4490849790879

I need to implement something like C# method Math.Round() in my GridGroupingControl Expression column.

Is it possible?

Thank you in advance,



Eswari S [Syncfusion]
Replied On April 3, 2014 06:18 AM UTC

Hi Alex,


Thank you for using Syncfusion products.


Your requirement can be achieved by adding custom function to ExpressionFieldEvaluator. Please refer to the following code snippets:


// Add function named Func that uses a delegate named ComputeFunc to define a custom calculation

        ExpressionFieldEvaluator evaluator = this.GridGroupingControl1.TableDescriptor.ExpressionFieldEvaluator;

        evaluator.AddFunction("Func", new ExpressionFieldEvaluator.LibraryFunction(ComputeFunc)); 

        Syncfusion.Web.UI.WebControls.Grid.Grouping.GridExpressionFieldDescriptor efd = new GridExpressionFieldDescriptor();


        // define expression using custom function.

        efd.Expression = "Func([ID]+ 50.9)";

        efd.Name = "ID + 500";



//compute func

  public string ComputeFunc(string s)


        return Math.Round(Convert.ToDecimal(s)).ToString();



For your convenience , we have attached the sample.


Please try this and let us know if you have any queries.



Eswari S

Eswari S [Syncfusion]
Replied On April 3, 2014 06:19 AM UTC

Hi Alex,

Please find sample from the attachment.

Eswari S

Attachment: 122993_407cdccf.zip


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

or the page will be automatically redirected to 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