Back to Devexpress

CompositeView.FindItem(String) Method

expressappframework-devexpress-dot-expressapp-dot-compositeview-dot-finditem-x28-system-dot-string-x29.md

latest6.2 KB
Original Source

CompositeView.FindItem(String) Method

Returns a specified View Item from a Composite View’s CompositeView.Items collection.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public ViewItem FindItem(
    string id
)
vb
Public Function FindItem(
    id As String
) As ViewItem

Parameters

NameTypeDescription
idString

A string value that is the View Item to be found in the current View’s CompositeView.Items collection.

|

Returns

TypeDescription
ViewItem

A ViewItem object that represents the View Item specified by the id parameter.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the FindItem(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-implement-dependent-views-in-a-dashboardview-filter-based-on-selection/CS/EFCore/DependentDashboardEF/DependentDashboardEF.Module/Controllers/DashboardFilterController.cs#L49

csharp
if (View.Id == DashboardViewId) {
    SourceItem = (DashboardViewItem)View.FindItem(FilterSourceID);
    TargetItem = (DashboardViewItem)View.FindItem(FilterTargetId);

xaf-how-to-show-the-number-of-nested-list-views-items-in-tab-captions/CS/EFCore/TabCountEF/TabCountEF.Win/Controllers/ContactDetailViewWinController.cs#L21

csharp
foreach(var item in (IModelLayoutGroup)e.ModelLayoutElement) {
    if(item is IModelLayoutViewItem layoutViewItem && View.FindItem(layoutViewItem.ViewItem.Id) is ListPropertyEditor propertyEditor) {
        propertyEditor.Frame.GetController<NestedListViewTabCountController>().Initialize(layoutGroup);

xaf-how-to-show-persistent-objects-in-a-non-persistent-objects-view/CS/EFCore/ComplexDialogEF/ComplexDialogEF.Module/Controllers/MyController.cs#L28

csharp
OrderTemplate parameters = (OrderTemplate)e.PopupWindow.View.CurrentObject;
ListPropertyEditor listPropertyEditor = ((DetailView)e.PopupWindow.View).FindItem("Services") as ListPropertyEditor;
IObjectSpace os = Application.CreateObjectSpace(typeof(Team));

xaf-how-to-dynamically-change-mask-settings-based-on-the-current-object/CS/ChangeEditMask.Module/Controllers/ChangeMaskControllerBase.cs#L34

csharp
if (ViewCurrentObject != null) {
    SetControlMaskSettings((PropertyEditor)View.FindItem("TestString"), ViewCurrentObject.Mask);
}

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/CS/XPO/EnumCheckbox/EnumCheckbox.Blazor.Server/Controllers/Class.cs#L36

csharp
//var detailView = Application.CreateDetailView(os, obj);
var it = View.FindItem(nameof(DemoObject.TestMe)) as MyEnumPropertyEditor;
//Set the date picker display mode to scroll picker

xaf-how-to-dynamically-change-mask-settings-based-on-the-current-object/VB/ChangeEditMask.Module/Controllers/ChangeMaskControllerBase.vb#L34

vb
If ViewCurrentObject IsNot Nothing Then
    SetControlMaskSettings(CType(View.FindItem("TestString"), PropertyEditor), ViewCurrentObject.Mask)
End If

See Also

AddItem

InsertItem

RemoveItem(String)

GetItems<T>()

CompositeView Class

CompositeView Members

DevExpress.ExpressApp Namespace