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";
this.GridGroupingControl1.TableDescriptor.ExpressionFields.Add(efd);
//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.
Regards,
Eswari S