In the recent release v2013.1 of the DevExpress WinForms Subscription, we introduced a brand new Spreadsheet Control. We are hard at work adding features to it and in v13.1.5 we’ve added new API to make working with the spreadsheet even easier.
New Cells API
v The CellValue.IsDateTime property indicates whether a cell contains a DateTime value.
v The Cell.IsDisplayedAsDateTime property indicates whether a number contained in a cell is displayed as a DateTime. This eliminates the need for checking cell value and format.
v Assigning a DateTime to a Cell.Value results in an automatic formatting of the value as a DateTime.
v To clear cell value, you can now assign it to null, e.g. Cell.Value = null
v The Cell.Value property can be assigned various object types. Built-in converters are responsible for correct interpretation and type conversion. The following methods have now been implemented: CellValue.ToObject, CellValue.FromObject, CellValue.TryCreateFromObject.
New Workbooks API
v The Evaluate method gets a string and evaluates it as if it were a cell formula. It can be used to convert a worksheet name to an object or a value. In the following example, the mass value is calculated by multiplying the value contained in the A1 cell by density (a defined name value), and rounding the result to two decimal places.
double mass = spreadsheetControl1.Document.Evaluate("=ROUND(A1*density,2)").NumericValue;
v The Calculate method recalculates the cells in all worksheets for the current workbook.
v The following events have been implemented and occur when worksheets, rows or columns are inserted or deleted.
ü event SheetInserted
ü event SheetRemoved
ü event RowsRemoved
ü event RowsInserted
ü event ColumnsRemoved
ü event ColumnsInserted
v The HasMacros property indicates the presence of macros in a workbook (XLSM file format)
v The IWorkbook.Range method provides access to the IRangeProvider interface that can parse a string in order to obtain a worksheet’s range:
Range range = spreadsheetControl1.Document.Range["Sheet1!A1:B2"];
Range range = spreadsheetControl1.Document.Range.Parse("Sheet1!A1:B2");
New Worksheet API
v Worksheet.MaxColumnCount allows you to limit the number of columns in a worksheet
v Worksheet.MaxRowCount allows you to limit the number of rows in a worksheet
New DefinedName API
· DefinedName.Range property gets or sets a worksheet cell or a range marked by the defined name.
Build v13.1.5 is available for immediate download from the Download Manager.