Back to Devexpress

How to: Create a Functional ButtonEdit

wpf-10483-controls-and-libraries-data-editors-getting-started-how-to-create-a-functional-buttonedit.md

latest1.2 KB
Original Source

How to: Create a Functional ButtonEdit

  • May 22, 2020
  • 2 minutes to read

ButtonEdit is a text editor which can display an unlimited number of fully customizable buttons.

This document demonstrates how to create a ButtonEdit control and customize its buttons.

Create a New Project and Add a ButtonEdit

  1. Run MS Visual Studio and create a new WPF Application project.
  2. Add a ButtonEdit component to the project.

Add Buttons to the ButtonEdit

  1. Right click the ButtonEdit and select Properties. Hide the default button by setting the ButtonEdit.AllowDefaultButton property to false.

  2. Select the Buttons property. Invoke Collection Editor: Buttons.

Add Functionality to the Buttons

  1. Handle the Click event of the “Apply” button to invoke a message box with information about the ButtonEdit control. Handle the Click event of the “Clear” button to clear the text in the ButtonEdit.

  2. Run the application to see the result.