Skip to main content
All docs
V25.2
  • BlazorViewExtensions.CustomizeViewItemControl<T>(View, Controller, Action<T>, String[]) Method

    Allows you to access and customize controls of the specified View Item in ASP.NET Core Blazor applications. This applies to View Items in Detail View, Dashboard View, and List View (DxGridListEditor and DxTreeListEditor in edit mode)

    Namespace: DevExpress.ExpressApp.Blazor.Utils

    Assembly: DevExpress.ExpressApp.Blazor.v25.2.dll

    NuGet Package: DevExpress.ExpressApp.Blazor

    Declaration

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

    Parameters

    Name Type Description
    view View

    A View that contains the specified View Item.

    controller Controller

    A Controller to customize controls of the specified View Item.

    customizeAction Action<T>

    A method to customize controls of the specified View Item.

    viewItemsId String[]

    The View Item identifier.

    Type Parameters

    Name Description
    T

    The View Item type.

    Remarks

    The following code snippet uses the CustomizeViewItemControl<T>(View, Controller, Action<T>, String[]) method to hide buttons for the specified Property Editor when in-place editing is enabled in a List View:

    File:
    MySolution.Blazor.Server\Controllers\LookupActionVisibilityController.cs

    using DevExpress.ExpressApp;
    using DevExpress.ExpressApp.Blazor.Editors;
    using DevExpress.ExpressApp.Blazor.Utils;
    
    namespace MySolution.Blazor.Server.Controllers;
    
    public class CustomizeInlinePropertyEditorController : ViewController<ListView> {
        protected override void OnActivated() {
            base.OnActivated();
            View.CustomizeViewItemControl<LookupPropertyEditor>(this, e => {
                e.HideNewButton();
                e.HideEditButton();
            }, nameof(MyClass.ReferenceProperty));
        }
    }
    
    See Also