xpo-devexpress-dot-xpo-dot-xpbasecollection-5199031f.md
Gets or sets the Session used by the current collection.
Namespace : DevExpress.Xpo
Assembly : DevExpress.Xpo.v25.2.dll
NuGet Package : DevExpress.Xpo
public Session Session { get; set; }
Public Property Session As Session
| Type | Description |
|---|---|
| Session |
The session with a connection to a data source. The default value is Session.DefaultSession.
|
Do not change this property value manually in your code, as it is intended to provide design-time support for the component. If you need to create the XPColleciton in the designer but specify the Session in code, use the XPBaseCollection.ResolveSession event. In the XPBaseCollection descendants (XPCollection and XPCollection<T>), you can also pass the Session object to the constructor.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Session property.
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.
checkedItems = (XPBaseCollection)PropertyValue;
XPCollection dataSource = new XPCollection(checkedItems.Session, MemberInfo.ListElementType);
IModelClass classInfo = application.Model.BOModel.GetClass(MemberInfo.ListElementTypeInfo.Type);
reporting-winforms-custom-report-storage/CS/XpoReportStorage.cs#L16
UnitOfWork Session {
get { return (UnitOfWork)items.Session; }
}
checkedItems = CType(PropertyValue, XPBaseCollection)
Dim dataSource As New XPCollection(checkedItems.Session, MemberInfo.ListElementType)
Dim classInfo As IModelClass = application.Model.BOModel.GetClass(MemberInfo.ListElementTypeInfo.Type)
reporting-winforms-custom-report-storage/VB/XpoReportStorage.vb#L19
Get
Return CType(items_Renamed.Session, UnitOfWork)
End Get
See Also