Is it possible to get Calling cell information like Cell Object or Row Index and Column Index of Cuntom or User Defined function calling cell in Evaluate Method?
public class Function_Factorial : Infragistics.Silverlight.Excel.CalcEngine.ExcelCalcFunction { public override string Name { get { return "factorial"; } }
protected override ExcelCalcValue Evaluate(ExcelCalcNumberStack numberStack, int argumentCount) { // can we get cell row index and column index here?
return new ExcelCalcValue(this.CalculateFactorial(val)); }
private Int64 CalculateFactorial( Int64 value ) { if ( value == 0 ) return 1;
if ( value < 3 ) return value;
Int64 factorial = 2;
checked { for ( Int64 i = 3; i <= value; i++ ) { factorial *= i; } }
return factorial; } }
I also posted same question on following link in SilverLight Section:
http://forums.infragistics.com/forums/t/36403.aspx
Thanks
Out of curiosity... why would you need the cell or the row? What are yuo trying to do with it? Perhaps if I know more about what you want to do, I can suggest an alternative.
Hi Mike,
I have to perform some db fetching related task and from there custom function implementation, I am calling webservice asynchronously. now when it returns the results then i need to know exact cell to update the results.
If I can get a reference or cell and row index or any other related object then I can do identify the call from results
Imran Javed Zia