XPInstantFeedbackSource Class
来源:互联网 发布:数据预处理步骤 编辑:程序博客网 时间:2024/06/16 01:23
A component that can be used as a data source for the GridControl and SearchLookUpEdit controls inInstant Feedback Mode.
XPInstantFeedbackSource类是可以给GridControl 和SearchLookUpEdit控件做数据源的一种即时回馈组件。
Namespace:DevExpress.Xpo
Assembly:DevExpress.Xpo.v12.2.dll
命名空间:DevExpress.Xpo,在程序集DevExrepss.Xpo.v12.2.dll
A data source supporting Instant Feedback mode must either implement the DevExpress.Data.Async.IAsyncListServer interface or implement the System.ComponentModel.IListSource interface and return anIAsyncListServer instance via the IListSource.GetList method. TheXPInstantFeedbackSource component implements the IListSource interface, and returns the list implementing theIAsyncListServer interface via the IListSource.GetList method.
The XPInstantFeedbackSource object serves as a conduit of information between the control and a target data store. When the control needs to display a specific portion of data, it calls a specific method of the boundXPInstantFeedbackSource object. This method sends a corresponding request to the data store, and while receiving the results, immediately passes them back to the control.
When creating an XPInstantFeedbackSource object, you need to provide descriptive information on the target data table (view) in the target data store. Declare a persistent class (anXPBaseObject descendant) that will correspond to the data table (see Basics of Creating Persistent Objects for Existing Data Tables). Then, pass the persistent class type to theXPInstantFeedbackSource constructor. You can use the ObjectType property, to choose the required persistent class at design time. In Instant Feedback mode, the target data table must contain a single key field, and the persistent class must contain a public property corresponding to the table key. If the data table does not contain a key field or the key is composed of several columns, it cannot be used as a data source.
![Note](http://documentation.devexpress.com/HelpResource.ashx?help=XPO&document=note.gif)
The XPInstantFeedbackSource is a read-only data source. To enable data editing in server mode, use theXPServerCollectionSource with the XPServerCollectionSource.AllowEdit property set to true.
The XPInstantFeedbackSource can only work with thread-safe properties. Reference properties are not thread safe. So, you should not use reference property descriptors when specifyingDisplayableProperties.
Assign the DefaultSorting, DisplayableProperties, FixedFilterCriteria, FixedFilterString, and ObjectType properties before binding the XPInstantFeedbackSource to the GridControl or SearchLookUpEdit. Once bound, changing any of these properties throws an exception.
For additional information on Instant Feedback mode, refer to Instant Feedback Mode.
This example demonstrates how to initialize a XPInstantFeedbackSource, to retrieve data from a "Person.Contact" data table (included in the AdventureWorks database shipped with MS SQL Server). The Person_Contact persistent class is declared, and mapped to the "Person.Contact" data table, using thePersistentAttribute attribute. Then, this class is used as a parameter in theXPInstantFeedbackSource constructor.
using DevExpress.Xpo;using DevExpress.Xpo.DB;using DevExpress.Data.Filtering;// The persistent class describing the "Person.Contact" table // from the AdventureWorks SQL database[Persistent("Person.Contact")]public class Person_Contact : XPLiteObject { [Key] public System.Int32 ContactID; public string FirstName; public string LastName; //...}public partial class Form1 : Form { //... public Form1() { // ... // Create a filter that selects records where last names start with 'A' CriteriaOperator criteria = CriteriaOperator.Parse("[LastName] LIKE ?", "A%"); // Specify the properties that will be available for binding string displayableProperties = "FirstName;LastName"; // Initialize an XPInstantFeedbackSource data source // supplying data from the Person.Contact data table XPInstantFeedbackSource instantDS = new XPInstantFeedbackSource( typeof(Person_Contact), displayableProperties, criteria); // Handle the ResolveSession event, // to provide a Session to the XPInstantFeedbackSource instantDS.ResolveSession += instantDS_ResolveSession; // Handle the DismissSession event, to dispose of the Session instantDS.DismissSession += instantDS_DismissSession; //... } void instantDS_ResolveSession(object sender, ResolveSessionEventArgs e) { Session session = new Session(); session.ConnectionString = @"Integrated Security=SSPI;Pooling=false; Data Source=.\SQLEXPRESS;Initial Catalog=MyDatabase"; session.Connect(); e.Session = session; } void instantDS_DismissSession(object sender, ResolveSessionEventArgs e) { IDisposable session = e.Session as IDisposable; if(session != null) { session.Dispose(); } }}
XPInstantFeedbackSource 类,对gridview简单来说就是:在页面你浏览了多少行,就只能操作多少行数据。
- XPInstantFeedbackSource Class
- XtraGrid更新时,如果数据源是XPInstantFeedBackSource
- XPInstantFeedBackSource如何使用FixedFilterCriteria及FixedFilterString
- class
- class
- class
- class
- class
- class
- Class
- Class
- class
- Class
- Class<?>
- class
- Class
- Class<?>
- Class
- cocos2d-x游戏开发(一)开始菜单
- 今年DevDays材料中文版已经可以下载
- eclipse 配置
- ffmpeg里的结构关联
- 大量静态页面的站点应该以什么样的姿势切入?
- XPInstantFeedbackSource Class
- Oracle11g使用exp导出空表
- js 为label标签和div标签赋值
- TreeVIew自定义样式
- HBase之三【HBase基础】HFile存储格式
- 百度之星——2012年12月23号竞赛题目一
- VS2008 Debug与Release的本质区别
- Script for Creating Changlog for Android
- 百度之星——2012年12月30号竞赛题目一