Ejemplo n.º 1
0
        private void UpdatedEventHandler(object sender, UpdatedEventArgs eventArgs)
        {
            foreach (var cellName in eventArgs.Cells)
            {
                // This updates the SpreadsheetPanel object with the values of all dependents of cellname.

                // Converts a cell name to col, row zero-based index.
                var row = Int32.Parse(cellName.Substring(1)) - 1;
                var col = cellName[0] - 65;

                var val = _spreadsheet.GetCellValue(cellName);
                if (val is FormulaError)
                {
                    spreadsheetPanel1.SetValue(col, row, "FormulaError. " + ((FormulaError)val).Reason);
                }
                else
                {
                    spreadsheetPanel1.SetValue(col, row, val.ToString());
                }
                DisplayUpdate(spreadsheetPanel1);
            }
        }
        private void UpdatedEventHandler(object sender, UpdatedEventArgs eventArgs)
        {
            foreach (var cellName in eventArgs.Cells)
            {
                // This updates the SpreadsheetPanel object with the values of all dependents of cellname.

                // Converts a cell name to col, row zero-based index.
                var row = Int32.Parse(cellName.Substring(1)) - 1;
                var col = cellName[0] - 65;

                var val = _spreadsheet.GetCellValue(cellName);
                if (val is FormulaError)
                {
                    spreadsheetPanel1.SetValue(col, row, "FormulaError. " + ((FormulaError)val).Reason);
                }
                else
                {
                    spreadsheetPanel1.SetValue(col, row, val.ToString());
                }
                DisplayUpdate(spreadsheetPanel1);
            }
        }