Cell.Tag Property
Gets or sets custom data associated with the cell.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v24.1.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Property Value
Type | Description |
---|---|
Object | An object that contains information 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 Object class to this property. The property value is cached depending on the cell reference, and the cache is automatically recalculated if the cell is moved, copied, or removed.
Consider 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
Tag
property values are not stored in the document history. Thus, theTag
objects are not restored by the Undo/Redo operations.The CellRange.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 (for example, a
List
), and then restore them after theCopyFrom
method execution.