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

[Solved] Custom Validation not being called using the Pop-Up Edit form

2 Answers 170 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Reid
Top achievements
Rank 2
Reid asked on 05 Mar 2012, 08:03 PM
Hello,

I have a Grid that is in Popup mode for the Client side record edit.  I have created a UserControl to display the Model for the user to edit named the same as the Model class and in the Shared folder.

I have implemented the IValidatableObject interface and it works fine with the default popup that Telerik pops up, the method below is called.

// This code is on the Model object that is bound to the Grid rows, the GridModel.

public IEnumerable<
ValidationResult> Validate(ValidationContext validationContext)

Yet when I use my version that uses the UserControl it displays the model and binds to it fine and posts to the controller, but the TryUpdateModel() method or the evaluation of ModelState.IsValid fail and the Update process does not begin, but my Validate() method does not get called.  "My Version" just means that I am not renaming the above mentioned UserControl to force the default behaviour or default Telerik popup form to show.

Does anyone know why the Validate is not being called for the form when the User Control is in the picture?
Regards,

Reid

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 09 Mar 2012, 10:32 AM
Hello Reid,

Unfortunately the information is not enough to determine what is causing this behavior. Could you please send us an application which replicates the behavior so we can assist you further.

Regards,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Reid
Top achievements
Rank 2
answered on 11 Mar 2012, 06:36 PM
Hello Nickolay,

Thank you for responding,  

Since this post I have understood how to implement the Client Side correctly and the Validation is being called.  I added the IValidator Implementation to the object and can control the emmision of model messages.

Thanks,

Reid
Tags
Grid
Asked by
Reid
Top achievements
Rank 2
Answers by
Nikolay Rusev
Telerik team
Reid
Top achievements
Rank 2
Share this question
or