Cell.Tag Property
Gets or sets custom data associated with the current cell.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v19.1.Core.dll
Declaration
Property Value
Type | Description |
---|---|
Object | A System.Object that contains information closely associated with the cell. |
Remarks
The Tag property is used to attach a temporary object to a worksheet cell. You can assign any type derived from the System.Object class to this property. The property value is cached depending on a cell reference, and the cache is automatically re-calculated if a cell is moved, copied, or removed.
Take into account the following restrictions when you use the Tag property:
Tag objects are not saved to a file and cannot be restored when you reload a document. If you need to save custom data in the document, use custom XML parts or custom document properties.
The Range.CopyFrom method clears cell tags in the target range when all content (PasteSpecial.All) or cell formatting is copied (PasteSpecial.Formats). To avoid this, you can store tag values in a variable (e.g., a List), and then restore them after executing the CopyFrom method.