Ticket S170473
Visible to All Users

The underlying control of a custom PropertyEditor should support the IGridInplaceEdit interface for complex in-place editing scenarios (e.g., data source filtering) in WinForms

created 12 years ago (modified 8 years ago)

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

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.