Hi, I need to create a custom string property editor with predefined values generated based on some properties of the current object.
I used this example https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument113101
and everything works fine in DetailView.
But in editable ListView SetupRepositoryItem is called only once and CurrentObject is null. So predefinedValues is empty.
I have read that I can assing different repositoryItem to different cells in GridView https://documentation.devexpress.com/#windowsforms/CustomDocument3020
But how can accomplish this task on property editor level?
How to define a custom property editor's settings based on the current object in a ListView
Answers approved by DevExpress Support
Hello Ivan,
The easiest way is to use a ViewController that customizes cell editors, for example, by handling the GridView.CustomRowCellEdit or GridView.ShownEditor method. You can also use the ColumnView.CustomColumnDisplayText event to customize the text displayed when a cell editor is inactive. Refer to the Access Grid Control Properties topic for additional information.
To accomplish this task without a controller, perform the following steps:
1. Create a custom editor control and a custom RepositoryItem for it, e.g., ComboBoxEdit and RepositoryItemComboBox descendants - see Custom Editors.
2. Implement the IGridInplaceEdit interface in the custom control (ComboBoxEdit descendant).
3. Refresh predefined items based on the received object in the IGridInplaceEdit.GridEditingObject property setter.