Back to Devexpress

How to: Create a ButtonEdit with a Custom Button

wpf-7420-controls-and-libraries-data-editors-examples-how-to-create-a-buttonedit-with-a-custom-button.md

latest852 B
Original Source

How to: Create a ButtonEdit with a Custom Button

  • Jun 07, 2019

The following example shows how to create a ButtonEdit with the Clear button that clears the editor's value.

xaml
<dxe:ButtonEdit x:Name="buttonEdit" Width="100"
                AllowDefaultButton="False">
    <dxe:ButtonEdit.Buttons>
        <dxe:ButtonInfo Content="Clear" Click="ButtonInfo_Click" />
    </dxe:ButtonEdit.Buttons>
</dxe:ButtonEdit>
csharp
private void ButtonInfo_Click(object sender, RoutedEventArgs e) {
    buttonEdit.EditValue = string.Empty;
}
vb
Private Sub ButtonInfo_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    buttonEdit.EditValue = String.Empty
End Sub