Skip to main content
.NET 8.0+

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

DetailViewExtensions.CustomizeViewItemControl<T>(DetailView, Controller, Action<T>, String[]) Method

Allows you to access and customize controls of specified View Items.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public static void CustomizeViewItemControl<T>(
    this DetailView view,
    Controller controller,
    Action<T> customizeAction,
    params string[] viewItemsId
)
    where T : ViewItem

#Parameters

Name Type Description
view DetailView

A DetailView that contains the specified View Items.

controller Controller

A Controller to customize controls of the specified View Items.

customizeAction Action<T>

A method to customize controls of the specified View Items.

viewItemsId String[]

Identifiers of View Items.

#Type Parameters

Name Description
T

The type of View Items.

#Remarks

The following code shows how to use this method to customize controls of the StartDate and DueDate Date Property Editors.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win.Editors;
// ...
public class CustomizeDateEditorController : ObjectViewController<DetailView, DemoTask> {
    protected override void OnActivated() {
        base.OnActivated();
        View.CustomizeViewItemControl<DatePropertyEditor>(this, CustomizeDateEditor, nameof(DemoTask.StartDate), nameof(DemoTask.DueDate));
    }
    private void CustomizeDateEditor(DatePropertyEditor propertyEditor) {
        propertyEditor.Control.Properties.ShowWeekNumbers = true;
    }
}

The following image demonstrates how this Controller affects the UI.

You can find the View Item’s identifier in the Model Editor.

See Also