Skip to main content
All docs
V25.1
  • .NET 8.0+

    DashboardViewExtensions.CustomizeViewItemControl<T>(DashboardView, Controller, Action<T>, String[]) Method

    Allows you to access and customize controls of the Dashboard View Item.

    Namespace: DevExpress.ExpressApp

    Assembly: DevExpress.ExpressApp.v25.1.dll

    NuGet Package: DevExpress.ExpressApp

    Declaration

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

    Parameters

    Name Type Description
    view DashboardView

    The specified View type.

    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

    ASP.NET Core Blazor

    The following code snippet enables HTML markup in a Static Text component:

    using DevExpress.ExpressApp;
    using DevExpress.ExpressApp.Blazor.Editors;
    
    namespace MySolution.Blazor.Server.Controllers;
    
    public class CustomizeDashboardViewController : ViewController<DashboardView> {
            protected override void OnActivated() {
                base.OnActivated();
                View.CustomizeViewItemControl<StaticTextViewItem>(this, item => {
                    item.ComponentModel.UseMarkupString = true;
                }, "StaticTextViewItemId");
            }
        }
    
    Windows Forms

    The following code snippet specifies the background color in a Static Text component:

    using DevExpress.ExpressApp;
    
    namespace MySolution.Win.Controllers;
    
    public class CustomizeDashboardViewController : ViewController<DashboardView> {
            protected override void OnActivated() {
                base.OnActivated();
                View.CustomizeViewItemControl<StaticTextViewItem>(this, item => {
                    if(item is StaticTextViewItem staticTextViewItem) {
                        staticTextViewItem.Label.BackColor = Color.Red;
                    }
                }, "StaticTextViewItemId");
            }
        }
    
    See Also