expressappframework-devexpress-dot-expressapp-dot-dashboardviewextensions-dot-customizeviewitemcontrol-x28-dashboardview-controller-action-viewitem-x29.md
Allows you to access and customize controls of the Dashboard View Item.
Namespace : DevExpress.ExpressApp
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
public static void CustomizeViewItemControl(
this DashboardView view,
Controller controller,
Action<ViewItem> customizeAction
)
<ExtensionAttribute>
Public Shared Sub CustomizeViewItemControl(
view As DashboardView,
controller As Controller,
customizeAction As Action(Of ViewItem)
)
| Name | Type | Description |
|---|---|---|
| view | DashboardView |
The Dashboard View.
| | controller | Controller |
A Controller to customize controls of the Dashboard View Item.
| | customizeAction | Action<ViewItem> |
A method to customize controls of the specified View Item.
|
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(this, item => {
if(item is StaticTextViewItem staticTextViewItem) {
staticTextViewItem.ComponentModel.UseMarkupString = true;
}
});
}
}
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(this, item => {
if(item is StaticTextViewItem staticTextViewItem) {
staticTextViewItem.Label.BackColor = Color.Red;
}
});
}
}
See Also