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

need a way to get actual row number when CurrentRowNotationEnabled zero notation is used

i need the GridFormulaEngine to give me the actual row number in a cell reference if I give it a CurrentRowNotation - like from ''B0'' get ''B32''. The RowIndex engine function needs an argument to either honor CurrentRowNotation or not. Also there are other functions on GridFormulaEngine that need the ability to deal with CurrentRowNotation- I have tried these with current row notation, and they don''t recognize it: GetCellsFromArgs could have a flag argument to either interpret a zero row reference as current row notation or not. GetValueFromGrid could have the same flag. I can add a function to the library if I can just figure out how to get at the current row from the engine. Is this possible?

1 Reply

AD Administrator Syncfusion Team August 1, 2005 04:21 PM UTC

In the upcoming 3.3. release, this code will parse the currentrow notaqtion properly. engine.AddFunction("Test", new GridFormulaEngine.LibraryFunction(ComputeTest)); engine.ForceParsingOfLibraryFunctionArguments = true;
private string ComputeTest(string args)
	return engine.GetValueFromArg(args);
With this code, if you enter "=Test(B0)" in a cell, the return value will be the value from column B in the same row. So, the CurrentRowNotation should work properly with function arguments if you have this flag set. That said, I do not think it will help you if you really need to know the actual rowindex corresponding to the 0-index. One way you could get this value is to add a column with the values 1,2,3, etc. Then using =X0 (where X is the column) will return the row number.

Live Chat Icon For mobile
Up arrow icon