This is a migrated thread and some comments may be shown as answers.

DataForm Validation - ValidatingItem()

1 Answer 76 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 20 Nov 2012, 11:01 AM
Hi,

i'm validaitin my Item with "ValidatinItem="MyForm_ValidatinItem":
private void VerbindungForm1_ValidatingItem(object sender, System.ComponentModel.CancelEventArgs e)
{
var employer = this.VerbindungForm1.CurrentItem as Verbindungen;
if (employer.Name.Count() < 1)
{
RadWindow.Alert("You have to enter a " + employer.Name);
}
}

This Works fine, but is it possible to chance the background of this fild now? Or set a border with Tooltip? And how do i stop the Comit if the Validation is false?

Thanks Best Regards
Rene

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 23 Nov 2012, 08:43 AM
Hello Rene,

 
I suggest you to check this help article, where you can find information about how to validate RadDataForm

 When defining custom fields you can specify the validation properties in the binding and perform the logic inside the property setter. This would be recommended approach if you want to stop the commit when the validation is false. For your convenience, I have prepared a sample project for you. Please find it attached. 

Regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DataForm
Asked by
ITA
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or