Skip to main content

FileManagerItemMetadata.GetValueByKey(String) Method

Returns the item’s metadata value with the specified key.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.1.dll

NuGet Package: DevExpress.Web


public object GetValueByKey(
    string key


Name Type Description
key String

A string value that is the key.


Type Description

An object which represents the item’s metadata value for the specified key property.


An item’s metadata are key-value pairs of string and object types, respectively. The item’s metadata can be specified using the FileManagerItemProperties.Metadata property and an appropriate FileManagerFile or FileManagerFolder constructor. To access the item’s metadata, use the FileManagerItem.Metadata property.

To obtain the item’s metadata, use the following methods:

public string GetId(FileManagerFile file) {
    var id = (int)file.Metadata.GetValueByKey("numberKey");
    return id.ToString();
public string GetGuid(FileManagerFile file) {
    var guid = (Guid)file.Metadata.GetValueByKey("guidKey");
    return guid.ToString(); 
public string GetCreationDate(FileManagerFile file) {
    var date = (DateTime)file.Metadata.GetValueByKey("dateKey");
    return date.ToShortDateString() + " " + date.ToShortTimeString(); 
See Also