Back to Devexpress

BlazorViewExtensions.CustomizeViewItemControl<T>(View, Controller, Action<T>) Method

expressappframework-devexpress-dot-expressapp-dot-blazor-dot-utils-dot-blazorviewextensions-dot-customizeviewitemcontrol-1-x28-devexpress-dot-expressapp-dot-view-devexpress-dot-expressapp-dot-controller-system-dot-action-0-x29.md

latest3.2 KB
Original Source

BlazorViewExtensions.CustomizeViewItemControl<T>(View, Controller, Action<T>) Method

Allows you to access controls of View Item that the specified View contains 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

csharp
public static void CustomizeViewItemControl<T>(
    this View view,
    Controller controller,
    Action<T> customizeAction
)
    where T : ViewItem
vb
<ExtensionAttribute>
Public Shared Sub CustomizeViewItemControl(Of T As ViewItem)(
    view As View,
    controller As Controller,
    customizeAction As Action(Of T)
)

Parameters

NameTypeDescription
viewView

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.

|

Type Parameters

NameDescription
T

The View Item type.

|

Remarks

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

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

csharp
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Blazor.Editors;
using DevExpress.ExpressApp.Blazor.Utils;
// ...
public class LookupActionVisibilityController : ViewController {
    protected override void OnActivated() {
        base.OnActivated();
        View.CustomizeViewItemControl<LookupPropertyEditor>(this, e => {
            e.HideNewButton();
            e.HideEditButton();
        });
    }
}

See Also

BlazorViewExtensions Class

BlazorViewExtensions Members

DevExpress.ExpressApp.Blazor.Utils Namespace