|
1 | | -<!-- default badges list --> |
2 | | - |
3 | | -[](https://supportcenter.devexpress.com/ticket/details/T137443) |
4 | | -[](https://docs.devexpress.com/GeneralInformation/403183) |
5 | | -[](#does-this-example-address-your-development-requirementsobjectives) |
6 | | -<!-- default badges end --> |
7 | | -# XAF WinForms - Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Fully Custom ViewItem) |
8 | | - |
9 | | -This example adds a custom control to a Detail View. See the following help topic for more information: [How to Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Fully Custom ViewItem)](https://docs.devexpress.com/eXpressAppFramework/113653/ui-construction/view-items-and-property-editors/how-to-add-a-button-to-a-detail-view-using-custom-view-item). |
10 | | - |
11 | | - |
12 | | - |
13 | | -## Implementation Considerations |
14 | | - |
15 | | -This is an advanced customization method that requires coding. Use it when you want to add an existing or custom control to the client area of a Detail View or Dashboard View. This approach allows you to obtain data from the current View object, if necessary. Your control can be unbound or can load data from external sources. |
16 | | - |
17 | | -If you want to bind a control to a business class property and add that control to both List View and Detail View, consider the [custom Property Editor approach](https://docs.devexpress.com/eXpressAppFramework/113097/ui-construction/view-items-and-property-editors/property-editors#custom-property-editors). |
18 | | - |
19 | | -This approach does not impose any restrictions on UI Control and XAF View interaction. You can implement custom logic in a `ViewController` or a custom UI control. [ViewItem](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Editors.ViewItem) descendants may implement their own inner logic. |
20 | | - |
21 | | -To display standard [XAF Actions](https://docs.devexpress.com/eXpressAppFramework/112622/ui-construction/controllers-and-actions/actions) in a Detail View, use the technique described in the following topic: [How to: Include an Action to a Detail View Layout](https://docs.devexpress.com/eXpressAppFramework/112816/ui-construction/view-items-and-property-editors/how-to-include-an-action-to-a-detail-view-layout). |
22 | | - |
23 | | -## Files to Review |
24 | | -* [ButtonDetailViewItemWin.cs](CS/EFCore/ButtonInFormEF/ButtonInFormEF.Win/ButtonDetailViewItemWin.cs) |
25 | | -* [Model.xafml](CS/EFCore/ButtonInFormEF/ButtonInFormEF.Win/Model.xafml) |
26 | | - |
27 | | -## Documentation |
28 | | -* [How to Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Built-in ActionContainerViewItem)](https://docs.devexpress.com/eXpressAppFramework/112816/ui-construction/view-items-and-property-editors/include-an-action-to-a-detail-view-layout) |
29 | | -* [How to Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Built-in ControlViewItem)](https://docs.devexpress.com/eXpressAppFramework/113652/ui-construction/view-items-and-property-editors/how-to-create-a-custom-control-detail-item) |
30 | | -* [How to: Include a Custom UI Control That Is Not Integrated by Default (WinForms, ASP.NET Web Forms, and ASP.NET Core Blazor)](https://docs.devexpress.com/eXpressAppFramework/113610/ui-construction/using-a-custom-control-that-is-not-integrated-by-default/using-a-custom-control-that-is-not-integrated-by-default) |
31 | | - |
32 | | -## More Examples |
33 | | -* [How to: Use a Custom View Item to Add a Button to a Detail View (Blazor)](https://github.com/DevExpress-Examples/xaf-custom-view-item-blazor) |
34 | | -* [XAF - Add a Custom Button to a Form (ASP.NET WebForms)](https://github.com/DevExpress-Examples/XAF_how-to-add-a-button-to-a-form-using-custom-view-item-t137443/tree/17.2.3+) |
35 | | -<!-- feedback --> |
| 1 | +<!-- default badges list --> |
| 2 | + |
| 3 | +[](https://supportcenter.devexpress.com/ticket/details/T137443) |
| 4 | +[](https://docs.devexpress.com/GeneralInformation/403183) |
| 5 | +[](#does-this-example-address-your-development-requirementsobjectives) |
| 6 | +<!-- default badges end --> |
| 7 | +# XAF WinForms - Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Fully Custom ViewItem) |
| 8 | + |
| 9 | +This example adds a custom control to a Detail View. See the following help topic for more information: [How to Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Fully Custom ViewItem)](https://docs.devexpress.com/eXpressAppFramework/113653/ui-construction/view-items-and-property-editors/how-to-add-a-button-to-a-detail-view-using-custom-view-item). |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Implementation Considerations |
| 14 | + |
| 15 | +This is an advanced customization method that requires coding. Use it when you want to add an existing or custom control to the client area of a Detail View or Dashboard View. This approach allows you to obtain data from the current View object, if necessary. Your control can be unbound or can load data from external sources. |
| 16 | + |
| 17 | +If you want to bind a control to a business class property and add that control to both List View and Detail View, consider the [custom Property Editor approach](https://docs.devexpress.com/eXpressAppFramework/113097/ui-construction/view-items-and-property-editors/property-editors#custom-property-editors). |
| 18 | + |
| 19 | +This approach does not impose any restrictions on UI Control and XAF View interaction. You can implement custom logic in a `ViewController` or a custom UI control. [ViewItem](https://docs.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Editors.ViewItem) descendants may implement their own inner logic. |
| 20 | + |
| 21 | +To display standard [XAF Actions](https://docs.devexpress.com/eXpressAppFramework/112622/ui-construction/controllers-and-actions/actions) in a Detail View, use the technique described in the following topic: [How to: Include an Action to a Detail View Layout](https://docs.devexpress.com/eXpressAppFramework/112816/ui-construction/view-items-and-property-editors/how-to-include-an-action-to-a-detail-view-layout). |
| 22 | + |
| 23 | +## Files to Review |
| 24 | +* [ButtonDetailViewItemWin.cs](CS/EFCore/ButtonInFormEF/ButtonInFormEF.Win/ButtonDetailViewItemWin.cs) |
| 25 | +* [Model.xafml](CS/EFCore/ButtonInFormEF/ButtonInFormEF.Win/Model.xafml) |
| 26 | + |
| 27 | +## Documentation |
| 28 | +* [How to Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Built-in ActionContainerViewItem)](https://docs.devexpress.com/eXpressAppFramework/112816/ui-construction/view-items-and-property-editors/include-an-action-to-a-detail-view-layout) |
| 29 | +* [How to Add an Unbound Control (Button) to the Form Layout in an XAF View (with a Built-in ControlViewItem)](https://docs.devexpress.com/eXpressAppFramework/113652/ui-construction/view-items-and-property-editors/how-to-create-a-custom-control-detail-item) |
| 30 | +* [How to: Include a Custom UI Control That Is Not Integrated by Default (WinForms, ASP.NET Web Forms, and ASP.NET Core Blazor)](https://docs.devexpress.com/eXpressAppFramework/113610/ui-construction/using-a-custom-control-that-is-not-integrated-by-default/using-a-custom-control-that-is-not-integrated-by-default) |
| 31 | + |
| 32 | +## More Examples |
| 33 | +* [How to: Use a Custom View Item to Add a Button to a Detail View (Blazor)](https://github.com/DevExpress-Examples/xaf-custom-view-item-blazor) |
| 34 | +* [XAF - Add a Custom Button to a Form (ASP.NET WebForms)](https://github.com/DevExpress-Examples/XAF_how-to-add-a-button-to-a-form-using-custom-view-item-t137443/tree/17.2.3+) |
| 35 | +<!-- feedback --> |
36 | 36 | ## Does this example address your development requirements/objectives? |
37 | 37 |
|
38 | 38 | [<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-add-custom-button-to-form-using-custom-view-item&~~~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-add-custom-button-to-form-using-custom-view-item&~~~was_helpful=no) |
39 | 39 |
|
40 | | -(you will be redirected to DevExpress.com to submit your response) |
41 | | -<!-- feedback end --> |
| 40 | +(you will be redirected to DevExpress.com to submit your response) |
| 41 | +<!-- feedback end --> |
0 commit comments