Aspose.Cells.GridWeb.Examples.CSharp.Articles.CalculateCustomFunction.Page_Load C# (CSharp) Method

Page_Load() protected method

protected Page_Load ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false && GridWeb1.IsPostBack == false)
            {
                // Assign your own custom calculation engine to GridWeb
                GridWeb1.CustomCalculationEngine = new GridWebCustomCalculationEngine();

                // Access the active worksheet and add your custom function in cell B3
                GridWorksheet sheet = GridWeb1.ActiveSheet;
                GridCell cell = sheet.Cells["B3"];
                cell.Formula = "=MYTESTFUNC(9.0)";

                // Calculate the GridWeb formula
                GridWeb1.CalculateFormula();
            }
        }
        // ExEnd:CalculateCustomFunction
CalculateCustomFunction