Back to Devexpress

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

expressappframework-devexpress-dot-expressapp-dot-detailviewextensions-dot-customizeviewitemcontrol-1-x28-devexpress-dot-expressapp-dot-detailview-devexpress-dot-expressapp-dot-controller-system-dot-action-0-system-dot-string-x29.md

latest3.6 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public static void CustomizeViewItemControl<T>(
    this DetailView view,
    Controller controller,
    Action<T> customizeAction,
    params string[] viewItemsId
)
    where T : ViewItem
vb
<ExtensionAttribute>
Public Shared Sub CustomizeViewItemControl(Of T As ViewItem)(
    view As DetailView,
    controller As Controller,
    customizeAction As Action(Of T),
    ParamArray viewItemsId As String()
)

Parameters

NameTypeDescription
viewDetailView

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

NameDescription
T

The type of View Items.

|

Remarks

The following code snippet customizes controls of the StartDate and DueDate Date Property Editors.

csharp
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

DetailViewExtensions Class

DetailViewExtensions Members

DevExpress.ExpressApp Namespace