This example shows how to add a custom component to a Detail View. We add a button to a Detail View and display a message when a user clicks the button.
- 
In the ASP.NET Core Blazor Module project, create a new Razor component and name it ButtonRenderer. In this component, configure the DxButton component, add the
Createmethod that creates RenderFragment, and handle theClickevent.Razor Component - CustomViewItem.Blazor.Server/Editors/ButtonViewItem/ButtonRenderer.razor
 - 
Ensure that the component's
Build Actionproperty is set toContent. - 
Create a
ComponentModelBasedescendant and name it ButtonModel. In this class, add properties and methods that describe your component.Component Model - CustomViewItem.Blazor.Server/Editors/ButtonViewItem/ButtonRenderer.razor
 - 
In the ASP.NET Core Blazor Module project, create the ButtonDetailViewItemBlazor View Item and decorate it with the ViewItemAttribute to make this View Item appear in the Application Model's ViewItems node.
 - 
Override the
CreateControlsCoremethod to get aButtonHolderinstance.ButtonHolderreturns a render fragment with our custom component. Note that in the XAF Blazor application,CreateControlsCoreshould return an instance that implements theIComponentContentHolderinterface. - 
Override the
OnControlsCreatedmethod. In this method, subscribe to the component model’sClickevent. Implement the logic in theComponentModel_Clickevent handler (in our example, the ShowMessage is called). - 
Override the BreakLinksToControls method. In this method, unsubscribe from the component model’s
Clickevent to release resources.Custom View Item - CustomViewItem.Blazor.Server/Editors/ButtonViewItem/ButtonDetailViewItemBlazor.cs.
 
See the following help topic for more information: How to: Use a Custom View Item to Add a Button to a Detail View.
XAF - Add a Custom Button to a Form (WinForms and ASP.NET WebForms)
(you will be redirected to DevExpress.com to submit your response)
