Class XPView
- Namespace
- DevExpress.Xpo
- Assembly
- DevExpress.Xpo.v24.1.dll
The view that stores data retrieved from persistent objects.
public class XPView : Component, IComponent, IDisposable, ISupportInitialize, IBindingList, IList, ICollection, IEnumerable, ITypedList, IFilteredXtraBindingList, IFilteredDataSource, IXPClassInfoAndSessionProvider, IXPClassInfoProvider, ISessionProvider, IObjectLayerProvider, IDataLayerProvider, IXPDictionaryProvider
- Inheritance
-
XPView
- Implements
-
IFilteredXtraBindingListIFilteredDataSource
- Inherited Members
Constructors
XPView()
Initializes a new instance of the XPView class with the default settings.
public XPView()
XPView(Session, XPClassInfo)
Initializes a new instance of the XPView class with the specified XPView.Session and XPView.ObjectClassInfo properties.
public XPView(Session session, XPClassInfo info)
Parameters
session
SessionA Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPView.Session property.
info
XPClassInfoAn XPClassInfo object which provides the metadata information for the objects to add to the view. This value is assigned to the XPView.ObjectClassInfo property.
XPView(Session, XPClassInfo, CriteriaOperatorCollection, CriteriaOperator)
Initializes a new instance of the XPView class with the specified settings.
public XPView(Session session, XPClassInfo info, CriteriaOperatorCollection properties, CriteriaOperator criteria)
Parameters
session
SessionA Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPView.Session property.
info
XPClassInfoAn XPClassInfo object which provides the metadata information for the objects to add to the view. This value is assigned to the XPView.ObjectClassInfo property.
properties
CriteriaOperatorCollectionA DevExpress.Data.Filtering.CriteriaOperatorCollection object which represents a collection whose elements are added to the XPView.Properties collection.
criteria
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.
XPView(Session, XPClassInfo, CriteriaOperatorCollection, CriteriaOperator, CriteriaOperator)
Initializes a new instance of the XPView class with the specified settings.
public XPView(Session session, XPClassInfo info, CriteriaOperatorCollection properties, CriteriaOperator criteria, CriteriaOperator groupCriteria)
Parameters
session
SessionA Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPView.Session property.
info
XPClassInfoAn XPClassInfo object which provides the metadata information for the objects to add to the view. This value is assigned to the XPView.ObjectClassInfo property.
properties
CriteriaOperatorCollectionA DevExpress.Data.Filtering.CriteriaOperatorCollection object which represents a collection whose elements are added to the XPView.Properties collection.
criteria
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.
groupCriteria
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object that specifies the grouping criteria.
XPView(Session, XPClassInfo, string, CriteriaOperator)
Initializes a new instance of the XPView class with the specified settings.
public XPView(Session session, XPClassInfo info, string properties, CriteriaOperator criteria)
Parameters
session
SessionA Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPView.Session property.
info
XPClassInfoAn XPClassInfo object which provides the metadata information for the objects to add to the view. This value is assigned to the XPView.ObjectClassInfo property.
properties
stringA string value which lists the property names separated by semicolons. For example, “FirstName + LastName;Company.Name;Address.City”.
criteria
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.
XPView(Session, Type)
Initializes a new instance of the XPView class with the specified session and type of persistent objects to include in the view.
public XPView(Session session, Type objType)
Parameters
session
SessionA Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPView.Session property.
objType
TypeThe type of persistent objects to include into the view.
XPView(Session, Type, CriteriaOperatorCollection, CriteriaOperator)
Initializes a new instance of the XPView class with the specified settings.
public XPView(Session session, Type objType, CriteriaOperatorCollection properties, CriteriaOperator criteria)
Parameters
session
SessionA Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPView.Session property.
objType
TypeThe type of persistent objects to include into the view.
properties
CriteriaOperatorCollectionA DevExpress.Data.Filtering.CriteriaOperatorCollection object which represents a collection whose elements are added to the XPView.Properties collection.
criteria
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.
XPView(Session, Type, string, CriteriaOperator)
Initializes a new instance of the XPView class with the specified settings.
public XPView(Session session, Type objType, string properties, CriteriaOperator criteria)
Parameters
session
SessionA Session object which represents the session that will be used to load and save persistent objects. This value is assigned to the XPView.Session property.
objType
TypeThe type of persistent objects to include in the view.
properties
stringA string value which lists the property names separated by semicolons. For example, “FirstName + LastName;Company.Name;Address.City”.
criteria
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria.
XPView(IContainer)
Initializes a new instance of the XPView class and adds it to a form’s container.
public XPView(IContainer container)
Parameters
container
IContainerAn IContainer object, which is the owner container of the created XPView instance.
Properties
CaseSensitive
Gets or sets whether string comparisons evaluated by the XPView on the client are case-sensitive.
public bool CaseSensitive { get; set; }
Property Value
- bool
true if string comparisons are case-sensitive; otherwise, false.
Count
Gets the number of records within the view.
[Browsable(false)]
public int Count { get; }
Property Value
- int
An integer value which specifies the number of records within the view.
Criteria
Gets or sets the criteria associated with the view.
[TypeConverter("DevExpress.Xpo.Design.CriteriaConverter, DevExpress.Xpo.v24.1.Design, Version=24.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a")]
public CriteriaOperator Criteria { get; set; }
Property Value
- CriteriaOperator
A DevExpress.Data.Filtering.CriteriaOperator descendant which represents the criteria associated with the view.
CriteriaString
Gets or sets the criteria used to filter objects while the view is being loaded.
[Browsable(false)]
public string CriteriaString { get; set; }
Property Value
- string
A string value that specifies the criteria used to filter objects while the view is being loaded.
Filter
Gets or sets the expression used to filter the rows displayed in the view (on the client side).
[Browsable(false)]
public CriteriaOperator Filter { get; set; }
Property Value
- CriteriaOperator
A DevExpress.Data.Filtering.CriteriaOperator object which specifies the expression used to filter the rows displayed in the view.
GroupCriteria
Gets or sets the grouping criteria which is associated with the view.
[TypeConverter("DevExpress.Xpo.Design.CriteriaConverter, DevExpress.Xpo.v24.1.Design, Version=24.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a")]
public CriteriaOperator GroupCriteria { get; set; }
Property Value
- CriteriaOperator
A DevExpress.Data.Filtering.CriteriaOperator object that specifies the grouping criteria.
GroupCriteriaString
Gets or sets the grouping criteria which is associated with the view.
[Browsable(false)]
public string GroupCriteriaString { get; set; }
Property Value
IsDesignMode
protected bool IsDesignMode { get; }
Property Value
this[int]
Provides indexed access to individual records within the view.
public ViewRecord this[int index] { get; }
Parameters
index
intA zero-based integer which specifies the record’s position within the view. If it’s negative or exceeds the last available index, an exception is raised.
Property Value
- ViewRecord
A ViewRecord object which represents the record at the specified position.
ObjectClassInfo
Gets the metadata information for the persistent objects retrieved by the view.
[TypeConverter("DevExpress.Xpo.Design.ObjectClassInfoTypeConverter, DevExpress.Xpo.v24.1.Design, Version=24.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a")]
public XPClassInfo ObjectClassInfo { get; set; }
Property Value
- XPClassInfo
An XPClassInfo object which provides the metadata information for the objects to add to the view.
ObjectType
Gets the type of the class whose metadata is provided by the XPView.ObjectClassInfo property.
[Browsable(false)]
public Type ObjectType { get; set; }
Property Value
Properties
Gets a collection of ViewProperty objects that represent view columns.
public ViewPropertiesCollection Properties { get; }
Property Value
- ViewPropertiesCollection
A ViewPropertiesCollection object which represents the collection of ViewProperty objects.
SelectDeleted
Specifies whether objects marked as deleted are retrieved by the XPView.
public bool SelectDeleted { get; set; }
Property Value
- bool
true, if objects marked as deleted are loaded to the collection from a data store; otherwise, false.
Session
Gets or sets the session which is used to load and save persistent objects.
[TypeConverter("DevExpress.Xpo.Design.SessionReferenceConverter, DevExpress.Xpo.v24.1.Design, Version=24.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a")]
public Session Session { get; set; }
Property Value
- Session
A Session object which represents the session that is used to load and save persistent objects.
SkipReturnedRecords
Gets or sets the number of records to exclude when populating the view.
public int SkipReturnedRecords { get; set; }
Property Value
- int
An integer value that specifies the number of records to exclude when populating the view. 0 indicates that records are not excluded.
Sorting
Provides access to the collection whose elements identify the sorted columns within the view.
public SortingCollection Sorting { get; set; }
Property Value
- SortingCollection
A SortingCollection object which contains information on the sorted columns within the view.
TopReturnedRecords
Gets or sets the maximum number of records retrieved by the view.
public int TopReturnedRecords { get; set; }
Property Value
- int
An integer value that specifies the maximum number of records retrieved by the view.
Methods
AddProperty(CriteriaOperator)
Creates a new ViewProperty object and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(CriteriaOperator property)
Parameters
property
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object which specifies the expression used to calculate the values in a column.
Returns
- ViewProperty
The ViewProperty object that was added to the collection.
AddProperty(string)
Creates a new ViewProperty object with the specified name and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(string property)
Parameters
property
stringA string value which specifies the property name. This value is assigned to the ViewProperty.Name property.
Returns
- ViewProperty
The ViewProperty object that was added to the collection.
AddProperty(string, CriteriaOperator)
Creates a new ViewProperty object with the specified expression and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(string name, CriteriaOperator property)
Parameters
name
stringA string value which specifies the property name. This value is assigned to the ViewProperty.Name property.
property
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object which specifies the expression used to calculate the values in a column.
Returns
- ViewProperty
The ViewProperty object that was added to the collection.
AddProperty(string, CriteriaOperator, bool)
Creates a new ViewProperty object with the specified expression and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(string name, CriteriaOperator property, bool group)
Parameters
name
stringA string value which specifies the property name. This value is assigned to the ViewProperty.Name property.
property
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object which specifies the expression used to calculate the values in a column.
group
booltrue to group the view by this property; otherwise, false. This value is assigned to the ViewProperty.Group property.
Returns
- ViewProperty
The ViewProperty object that was added to the collection.
AddProperty(string, CriteriaOperator, bool, bool, SortDirection)
Creates a new ViewProperty object with the specified settings and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(string name, CriteriaOperator property, bool group, bool fetch, SortDirection sorting)
Parameters
name
stringA string value which specifies the property name. This value is assigned to the ViewProperty.Name property.
property
CriteriaOperatorA DevExpress.Data.Filtering.CriteriaOperator object which specifies the expression used to calculate the values in a column.
group
booltrue to group the view by this property; otherwise, false. This value is assigned to the ViewProperty.Group property.
fetch
booltrue to retrieve data; otherwise, false. This value is assigned to the ViewProperty.Fetch property.
sorting
SortDirectionA SortDirection enumeration value which specifies the column’s sort order. This value is assigned to the ViewProperty.Sorting property.
Returns
- ViewProperty
The ViewProperty object that was added to the collection.
AddProperty(string, string)
Creates a new ViewProperty object with the specified expression and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(string name, string property)
Parameters
name
stringA string value which specifies the property name. This value is assigned to the ViewProperty.Name property.
property
stringA string value which specifies the expression used to calculate the values in a column. This value is assigned to the ViewProperty.Property property.
Returns
- ViewProperty
The ViewProperty object that was added to the collection.
AddProperty(string, string, bool)
Creates a new ViewProperty object with the specified expression and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(string name, string property, bool group)
Parameters
name
stringA string value which specifies the property name. This value is assigned to the ViewProperty.Name property.
property
stringA string value which specifies the expression used to calculate the values in a column. This value is assigned to the ViewProperty.Property property.
group
booltrue to group the view by this property; otherwise, false. This value is assigned to the ViewProperty.Group property.
Returns
- ViewProperty
The ViewProperty object that was added to the collection.
AddProperty(string, string, bool, bool, SortDirection)
Creates a new ViewProperty object with the specified settings and appends it to the XPView.Properties collection.
public ViewProperty AddProperty(string name, string property, bool group, bool fetch, SortDirection sorting)
Parameters
name
stringA string value which specifies the property name. This value is assigned to the ViewProperty.Name property.
property
stringA string value which specifies the expression used to calculate the values in a column. This value is assigned to the ViewProperty.Property property.
group
booltrue to group the view by this property; otherwise, false. This value is assigned to the ViewProperty.Group property.
fetch
booltrue to retrieve data; otherwise, false. This value is assigned to the ViewProperty.Fetch property.
sorting
SortDirectionA SortDirection enumeration value which specifies the column’s sort order. This value is assigned to the ViewProperty.Sorting property.
Returns
- ViewProperty
A ViewProperty object that was added to the collection.
LoadAsync()
Asynchronously loads data from the data store into the view.
public bool LoadAsync()
Returns
- bool
true, if the current method call started collection loading; otherwise, false.
LoadAsync(AsyncLoadObjectsCallback)
Asynchronously loads data from the data store into the view, and notifies upon completion.
public bool LoadAsync(AsyncLoadObjectsCallback callback)
Parameters
callback
AsyncLoadObjectsCallbackA DevExpress.Xpo.Helpers.AsyncLoadObjectsCallback delegate to be called after loading is complete.
Returns
- bool
true, if the current method call started collection loading; otherwise, false.
OnResolveSession(ResolveSessionEventArgs)
protected virtual void OnResolveSession(ResolveSessionEventArgs args)
Parameters
Reload()
Clears the view and marks it to be reloaded with data from the data store.
public void Reload()
Events
ListChanged
Occurs when the view’s settings are changed.
public event ListChangedEventHandler ListChanged
Event Type
ResolveSession
Enables the view to be associated with a session.
public event ResolveSessionEventHandler ResolveSession