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

ShowValueEditorEventArgs.CustomRepositoryItem Property

Allows you to specify a custom editor to be opened instead of the default one, specified by the Editor property.

Namespace: DevExpress.XtraEditors.Filtering

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public RepositoryItem CustomRepositoryItem { get; set; }

#Property Value

Type Description
RepositoryItem

A RepositoryItem descendant identifying the custom editor that will be created and displayed instead of the default one.

#Remarks

To provide a custom editor instead of the default editor, create a corresponding descendant of the RepositoryItem class and assign it to the CustomRepositoryItem property.

#Example

This example handles the FilterControl.CustomValueEditor event to assign custom editors (Spin Editor and Calc Editor) to value operands in Data Grid’s embedded FilterControl.

The Data Grid’s ColumnView.FilterEditorCreated event is used to subscribe to the FilterControl.CustomValueEditor event.

FilterControl-CustomValueEditor

private void gridView1_FilterEditorCreated(object sender, FilterControlEventArgs e) {
    e.FilterEditor.CustomValueEditor += FilterEditor_CustomValueEditor;
}

readonly RepositoryItemSpinEdit spinEdit = new RepositoryItemSpinEdit();
readonly RepositoryItemCalcEdit calcEdit = new RepositoryItemCalcEdit();

private void FilterEditor_CustomValueEditor(object sender, CustomValueEditorArgs e) {
    if (e.Node.FirstOperand.PropertyName != "Payment") return;
    RepositoryItemTextEdit item = null;
    if (e.ElementIndex == 2)
        item = spinEdit;
    else
        item = calcEdit;
    var settings = item.MaskSettings.Configure<MaskSettings.Numeric>();
    settings.MaskExpression = "c";
    e.RepositoryItem = item;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomRepositoryItem 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