Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

FileSystemItem.CustomFields Property

Gets the collection of custom fields bound to a file system item.

Namespace: DevExtreme.AspNet.Mvc.FileManagement

Assembly: DevExtreme.AspNet.Core.dll

#Declaration

C#
public IDictionary<string, object> CustomFields { get; }

#Property Value

Type Description
IDictionary<String, Object>

A collection of custom fields.

#Remarks

Use the CustomFields property to access and manage a file system item’s custom fields.

Refer to the FileManager - Binding to Entity Framework ORM online demo to see the whole code.

public IEnumerable<FileSystemItem> GetItems(FileSystemLoadItemOptions options) {
    int parentId = ParseKey(options.Directory.Key);
    var fileItems = GetDirectoryContents(parentId);

    var clientItemList = new List<FileSystemItem>();
    foreach(var item in fileItems) {
        var clientItem = new FileSystemItem {
            Key = item.Id.ToString(),
            Name = item.Name,
            IsDirectory = item.IsDirectory,
            DateModified = item.Modified
        };

        clientItem.CustomFields["modifiedBy"] = item.ModifiedBy.FullName;
        clientItem.CustomFields["created"] = item.Created;
        clientItemList.Add(clientItem);
    }
    return clientItemList;
}

#Concepts

#Online Demo

See Also