Back to Devexpress

TreeListCustomizeDataRowEditorEventArgs.EditSettings Property

blazor-devexpress-dot-blazor-dot-treelistcustomizedataroweditoreventargs.md

latest2.3 KB
Original Source

TreeListCustomizeDataRowEditorEventArgs.EditSettings Property

Returns an object that contains editor settings.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public IEditSettings EditSettings { get; }

Property Value

TypeDescription
IEditSettings

An object that contains editor settings.

|

Remarks

The TreeList configures editor settings for individual columns based on associated data types. You can customize these settings in markup. The EditSettings property returns customized (if any) settings of the processed editor.

Cast an object, returned by the EditSettings property, to a particular editor’s settings interface when you need editor-specific settings:

csharp
void OnCustomizeDataRowEditor(TreeListCustomizeDataRowEditorEventArgs e) {
    if (e.FieldName == "HireDate") {
        var HireDateSettings = e.EditSettings as IDateEditSettings;
        if (e.IsNewRow) {
            // Limits the available hire date for new employees two weeks ahead.
            HireDateSettings.MinDate = @DateTime.Today;
            HireDateSettings.MaxDate = @DateTime.Today.AddDays(14);
        } else {
            // Disables the hire date editing.
            HireDateSettings.Enabled = false;
            HireDateSettings.ShowDropDownButton = false;
        }
    }
}

You can also cast the returned object to the base interface if the editor type is unknown or you need common settings:

csharp
void OnCustomizeDataRowEditor(TreeListCustomizeDataRowEditorEventArgs e) {
    // Shows the validation icon for every editor
    if(e.EditSettings is ITextEditSettings settings)
        settings.ShowValidationIcon = true;
}

Refer to the CustomizeDataRowEditor event description for additional information and an example.

See Also

TreeListCustomizeDataRowEditorEventArgs Class

TreeListCustomizeDataRowEditorEventArgs Members

DevExpress.Blazor Namespace