Skip to content

Commit 914e12c

Browse files
upd readme (#3)
1 parent e2fbf19 commit 914e12c

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

Readme.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
<!-- default badges list -->
2-
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128587367/22.2.6%2B)
32
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E774)
43
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
54
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
65
<!-- default badges end -->
7-
<!-- default file list -->
8-
*Files to look at*:
96

10-
* [Model.xafml](CS/EFCore/LookUpButtonEF/LookUpButtonEF.Win/Model.xafml)
11-
* [MyLookupPropertyEditor.cs](CS/EFCore/LookUpButtonEF/LookUpButtonEF.Win/Editors/MyLookupPropertyEditor.cs)
12-
<!-- default file list end -->
13-
# How to add a custom button into WinForms LookupPropertyEditor to edit the currently selected record
147

8+
# XAF WinForms - How to add a custom Edit button to LookupPropertyEditor
159

16-
<p>
17-
LookupPropertyEditor is represented in a detail view by the LookUpEdit control, which allows various customizations. You can customize it by adding a special button that invokes a detail view for the selected object or performs any other actions.<br /><br />
18-
10+
This example creates a [LookupPropertyEditor](https://docs.devexpress.com/eXpressAppFramework/113572/business-model-design-orm/data-types-supported-by-built-in-editors/reference-foreign-key-complex-type-properties#lookuppropertyeditor-1) descendant with a custom Edit button.
1911
![image](https://github.com/DevExpress-Examples/XAF_how-to-add-a-custom-button-into-lookuppropertyeditor-to-edit-the-currently-selected-record-e774/assets/14300209/af3ac121-79d7-403d-9072-4e151cffd573)
20-
21-
<br /><br /><strong>See Also:</strong></p>
22-
<p><a href="https://www.devexpress.com/Support/Center/p/e1101">How to work with referenced properties via a simple drop down list instead of the standard LookupPropertyEditor (Example)</a></p>
2312

24-
<br/>
13+
## Implementation Details
2514

15+
Follow the steps below to add a custom button to LookupPropertyEditor:
16+
17+
1. Create a [LookupPropertyEditor](https://docs.devexpress.com/eXpressAppFramework/113572/business-model-design-orm/data-types-supported-by-built-in-editors/reference-foreign-key-complex-type-properties#lookuppropertyeditor-1) descendant ([MyLookupPropertyEditor.cs](CS/EFCore/LookUpButtonEF/LookUpButtonEF.Win/Editors/MyLookupPropertyEditor.cs)).
18+
19+
2. Access the [RepositoryItemLookupEdit](https://docs.devexpress.com/WindowsForms/DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) and use its settings to customize LookupPropertyEditor:
20+
* Add a custom button to the [Buttons](https://docs.devexpress.com/WindowsForms/DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit.Buttons) collection.
21+
* Subscribe to the [ButtonClick](https://docs.devexpress.com/WindowsForms/DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit.ButtonClick) event and implement custom logic in the event handler.
22+
3. Assign the LookupPropertyEditor descendant to a business object's PropertyEditorType in the Model Editor ([Model.xafml](CS/EFCore/LookUpButtonEF/LookUpButtonEF.Win/Model.xafml)).
23+
24+
## Files to Review
25+
26+
- [Model.xafml](CS/EFCore/LookUpButtonEF/LookUpButtonEF.Win/Model.xafml)
27+
- [MyLookupPropertyEditor.cs](CS/EFCore/LookUpButtonEF/LookUpButtonEF.Win/Editors/MyLookupPropertyEditor.cs)
28+
29+
## Documentation
30+
31+
- [Customize a Built-in Property Editor (WinForms)](https://docs.devexpress.com/eXpressAppFramework/113104/ui-construction/view-items-and-property-editors/property-editors/customize-a-built-in-property-editor-winforms)
2632

2733
<!-- feedback -->
2834
## Does this example address your development requirements/objectives?
2935

30-
[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=XAF_how-to-add-a-custom-button-into-lookuppropertyeditor-to-edit-the-currently-selected-record-e774&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=XAF_how-to-add-a-custom-button-into-lookuppropertyeditor-to-edit-the-currently-selected-record-e774&~~~was_helpful=no)
36+
[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=xaf-win-custom-button-in-lookup-property-editor&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=xaf-win-custom-button-in-lookup-property-editor&~~~was_helpful=no)
3137

3238
(you will be redirected to DevExpress.com to submit your response)
3339
<!-- feedback end -->

0 commit comments

Comments
 (0)