Back to Devexpress

CompositeView.GetItems<T>() Method

expressappframework-devexpress-dot-expressapp-dot-compositeview-dot-getitems-1.md

latest4.6 KB
Original Source

CompositeView.GetItems<T>() Method

Returns View Items of the specified type from the CompositeView.Items collection.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public IList<T> GetItems<T>()
    where T : class
vb
Public Function GetItems(Of T As Class) As IList(Of T)

Type Parameters

Name
T

Returns

TypeDescription
IList<T>

A generic list that contains View Items of a specified type found in the CompositeView.Items collection.

|

Remarks

Set the generic type argument T to the required View Item type to get an array of View Items of this type found in the current Composite View’s CompositeView.Items collection.

For example, you can get all Static Images of a Composite View. For this purpose, set StaticImage as a generic type argument.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetItems<T>() 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-access-the-master-detailview-information-from-a-nested-listview-controller/CS/EFCore/GetMasterFrameEF/GetMasterFrameEF.Module/Controllers/MasterDetailViewController.cs#L25

csharp
base.OnActivated();
foreach (ListPropertyEditor lpe in View.GetItems<ListPropertyEditor>()) {
    if (lpe.Frame != null) {

XAF-search-objects-using-complex-criterion/CS/Dennis.Search.Win/SearchObjectViewController.cs#L41

csharp
if(dv != null) {
    foreach(ListPropertyEditor editor in dv.GetItems<ListPropertyEditor>())
        if(editor.PropertyName == SearchResultsCollectionName)

XAF-search-objects-using-complex-criterion/VB/Dennis.Search.Win/SearchObjectViewController.vb#L53

vb
If dv IsNot Nothing Then
    For Each editor As ListPropertyEditor In dv.GetItems(Of ListPropertyEditor)()
        If Equals(editor.PropertyName, SearchResultsCollectionName) Then AddHandler editor.ControlCreated, New EventHandler(Of EventArgs)(AddressOf editor_ControlCreated)

See Also

FindItem(String)

AddItem

InsertItem

RemoveItem(String)

CustomizeViewItemControl

CompositeView Class

CompositeView Members

DevExpress.ExpressApp Namespace