DetailViewExtensions.CustomizeViewItemControl(DetailView, Controller, Action<ViewItem>, String[]) Method
In This Article
Allows you to access and customize controls of specified View Items.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v24.2.dll
NuGet Package: DevExpress.ExpressApp
#Declaration
public static void CustomizeViewItemControl(
this DetailView view,
Controller controller,
Action<ViewItem> customizeAction,
params string[] viewItemsId
)
#Parameters
Name | Type | Description |
---|---|---|
view | Detail |
A Detail |
controller | Controller | A Controller to customize controls of the specified View Items. |
customize |
Action<View |
A method to customize controls of the specified View Items. |
view |
String[] | Identifiers of View Items. |
#Remarks
The following code shows how to use this method to customize controls of the ActualWorkHours and EstimatedWorkHours View Items.
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
using DevExpress.XtraEditors;
// ...
public class SetMinValueController : ObjectViewController<DetailView, DemoTask> {
protected override void OnActivated() {
base.OnActivated();
View.CustomizeViewItemControl(this, SetMinValue, nameof(DemoTask.ActualWorkHours), nameof(DemoTask.EstimatedWorkHours));
}
private void SetMinValue(ViewItem viewItem) {
SpinEdit spinEdit = (SpinEdit)viewItem.Control;
spinEdit.Properties.MinValue = 0;
}
}
You can find the View Item’s identifier in the Model Editor.
See Also