The most common scenarios include data source filtering (e.g., the functionality of the DataSourceCriteria, DataSourceProperty and similar attributes) and obtaining information of the currently edited record in ListView for internal purposes (e.g., obtaining object type information). Standard XAF WihForms PropertyEditors whose underlying controls implement the DevExpress.ExpressApp.Win.Core.IGridInplaceEdit interface include LookupPropertyEditor, ObjectPropertyEditor, PopupCriteriaPropertyEditor and ExpressionPropertyEditor. You can refer to their source code for more details. In addition, you can consider checking the How to work with referenced properties via a simple drop down list instead of the standard LookupPropertyEditor (Example) example source as well. In this example, notice how the current object is retrieved via the FindEditingObject method:
C#protected virtual void InitializeDataSource(LookUpEditEx lookup) {
if(lookup != null && lookup.Properties != null && lookup.Properties.Helper != null) {
lookup.Properties.DataSource = lookup.Properties.Helper.CreateCollectionSource(lookup.FindEditingObject()).List;
}
}
In our GridListEditor we have special code that detects whether the underlying control supports the IGridInplaceEdit interface and automatically assigns the IGridInplaceEdit.GridEditingObject property in GridView events.
If you use your PropertyEditor in other places (e.g., a vertical grid or tree list where you provided a custom inplace editing functionality), you can manually handle corresponding control events to set the IGridInplaceEdit.GridEditingObject property when an editor control is being shown. See the How to assign DataSourceProperty to a Cell in a TreeList ticket for an example.
See Also:
eXpressApp Framework > Concepts > UI Construction > Implement Custom Property Editors