New to Telerik UI for WPF? Start a free 30-day trial
Avoid Raising ValidatingItem on Add Button Click
Updated on Sep 15, 2025
Environment
| Product Version | 2018.3.1016 |
| Product | RadDataForm for WPF |
Description
How to avoid raising validation when the Add button of RadDataForm gets clicked.
Solution
Create a custom DataFormCommandProvider and override its AddNew method. In the method call only the AddNewItem method of RadDataForm.
C#
public class CustomCommandProvider : DataFormCommandProvider
{
public CustomCommandProvider() : base(null)
{
}
public CustomCommandProvider(RadDataForm dataForm)
: base(dataForm)
{
this.DataForm = dataForm;
}
protected override void AddNew()
{
if (this.DataForm != null)
{
this.DataForm.AddNewItem();
}
}
}
Then assign the custom provider to the CommandProvider property of RadDataForm.
C#
this.radDataForm.CommandProvider = new CustomCommandProvider(this.radDataForm);