Hi Gregor,
Thank you for your interest in Syncfusion products.
If you want to define the custom expression field descriptor for expression column, you need to define the string concatenation in ComputeFunc method. Please make use of below code and attached sample,
Dim evaluator As ExpressionFieldEvaluator = Me.gridGroupingControl1.TableDescriptor.ExpressionFieldEvaluator
evaluator.AddFunction("CONCATENATE", New Syncfusion.Grouping.ExpressionFieldEvaluator.LibraryFunction(ComputeFunc))
Dim f2 As ExpressionFieldDescriptor = New ExpressionFieldDescriptor("Result2", "CONCATENATE([Val1],[Val2])")
gridGroupingControl1.Engine.TableDescriptor.ExpressionFields.Add(f2)
Public Function ComputeFunc(ByVal s As String) As String
Dim comma As Char = Convert.ToChar(Me.gridGroupingControl1.Culture.TextInfo.ListSeparator)
Dim ss() As String = s.Split(comma)
Dim str1 As String = ss(0)
Dim str2 As String = ss(1)
Return (str1 + str2)
End Function
Please let me know if you have any concerns.
Regards,
Neelakandan
Hi Gregor,
Regret for the inconvenience caused.
We analyzed your scenario at our end. We could not able to reproduce an issue in 11.1.0.21 version that you are mentioned in your last update. Please refer the below code and customize your expression function as per below code and also please refer the below attached sample video,
Dim evaluator As ExpressionFieldEvaluator = Me.gridGroupingControl1.TableDescriptor.ExpressionFieldEvaluator
evaluator.AddFunction("CONCATENATE", New Syncfusion.Grouping.ExpressionFieldEvaluator.LibraryFunction(AddressOf ComputeFunc))
Dim newExpr As New ExpressionFieldDescriptor("Result2", "CONCATENATE([Val1],[Val2])")
gridGroupingControl1.Engine.TableDescriptor.ExpressionFields.Add(newExpr)
Please refer the below UG link:
http://help.syncfusion.com/ug/windows%20forms/default.htm#!Documents/howtoaddcustomcalcul.htm
Please let me know if you have any concerns.
Regards,
Neelakandan
Hello,
those were the two most useless answers I have ever read.
Is there anyone out there who is willing to read my posts, understand them and help me with my problem?
Gregor.
Hi Gregor,
We deeply regret for the inconvenience caused,
We have analyzed the reported issue in our end, GGC returns “Invalid Expression” error while you have used the custom function name as “GETVENDOR”. Because some issues are occurring in our source while parse the formula text. So please use any suitable name for your methods. Here we have modified the name as “CONC” please refer the below code.
evaluator.AddFunction("CONC", New Syncfusion.Grouping.ExpressionFieldEvaluator.LibraryFunction(AddressOf ComputeCustomAdd))
Dim f2 As New ExpressionFieldDescriptor("Result2", "CONC([Val1],[Val2])")
So please refer the attached sample and image also this will resolve the reported issue in your end and it returns the proper solution as you expected in ypur end. Fix for this issue will be included in our main volume release 2014 Vol 4. If you need fix as earlier that volume release please create incident using your Direct trac account, we will provide fix as earlier.
Regards,
Vinish Kumar,