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. Image for the cookie policy date
close icon

GridFormulaEngine.LibraryFunction information

I want to implement some function help (like excels function menu).

Spec is along the following lines:
-Simple form containing two list boxes.
-Left hand listbox contains a list of available grid functions.
-Right hand list box shows the required and optional arguments for the selected function in the left hand listbox

I can get a list of function names easily as follows:

SortedDictionary functionList = new SortedDictionary();

private void PopulateFormulaeList()
{
functionList.Clear();
foreach (DictionaryEntry de in formulaCellModel.Engine.LibraryFunctions)
{
functionList.Add(de.Key as string , de.Value as GridFormulaEngine.LibraryFunction);
}
}
To get the argument names I then look at the objects of type System.Reflection.ParameterInfo in unction.Method.GetParameters(). However the only information I can get from the ParameterInfo Name and type properties is the .net parameter information (i.e. that there is a single string argument called args, argList or range in most cases).

Is it possible to get information about the individual argument that the user sees when writing the formulae types and if they are options for each argument in a GridFormulaEngine.LibraryFunction.

Many thanks,
Steve

1 Reply

JS Jeba S Syncfusion Team August 21, 2007 01:35 PM UTC

Hi Steve,

Thank you for your details.

Currenlty there is no way to get information about the individual argument. In any formula that references the name, the string would be substituted before parsing and computing takes place.

Please refer this sample which list the formulas with arguments in dropdown list.
http://websamples.syncfusion.com/samples/Grid.Windows/34349_1/main.htm

In the sample, custom cell is created with a static field of type datatable. In the form load this table is filled with the syntaxes of the library functions from the FormulaEngine. This datatable is used to fill the dropdown listbox with the matched function syntax.

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.


Loader.
Live Chat Icon For mobile
Up arrow icon