|116102||Apr 2,2014 06:46 PM UTC||Apr 3,2014 06:19 AM UTC||ASP.NET Web Forms (Classic)||2|
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,
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";
public string ComputeFunc(string s)
For your convenience , we have attached the sample.
Please try this and let us know if you have any queries.
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.