Skip to main content
Row

DocumentCustomProperties.Names Property

Provides access to a list of custom property names.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

IEnumerable<string> Names { get; }

Property Value

Type Description
IEnumerable<String>

A list of custom property names which implements the IEnumerable<T><String,> interface.

Remarks

Use the Names property to iterate through all custom document properties specified in a workbook.

Example

The example below demonstrates how to define the custom document properties for a workbook. Use the DocumentProperties.Custom property to get access to a storage of all user-defined properties specified in a document. To set an individual custom property with the specified name, use the DocumentCustomProperties.Item property.

View Example

' Set the custom document properties.
workbook.DocumentProperties.Custom("Revision") = 3
workbook.DocumentProperties.Custom("Completed") = True
workbook.DocumentProperties.Custom("Published") = Date.Now
' Display the specified custom properties in a worksheet.
Dim customPropertiesNames As IEnumerable(Of String) = workbook.DocumentProperties.Custom.Names
Dim rowIndex As Integer = 2
For Each propertyName As String In customPropertiesNames
    worksheet(rowIndex, 1).Value = propertyName
    worksheet(rowIndex, 2).Value = workbook.DocumentProperties.Custom(propertyName)
    If worksheet(rowIndex, 2).Value.IsDateTime Then
        worksheet(rowIndex, 2).NumberFormat = "[$-409]m/d/yyyy h:mm AM/PM"
    End If
    rowIndex += 1
Next propertyName

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Names property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also