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

cause validation in gridview

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 27 Jun 2013, 06:42 AM
Hi ,
         In Project i have create one insert form with validation and editable gridview it shows in same page .In this i want to update details in gridview .But validation control for insert form will takes place in gridview update event. So i want to make cause validation  false for gridview update.Please give me a solution.

Thanks,
Arun.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 01 Jul 2013, 11:33 AM
Hello Arun,

Thank you for contacting us.

In RadGrid it is possible to validate data explicitly on edit or on insert. If I understand you correctly, you want to validate data only on insertion which you can easily accomplish by wiring OnItemCreated event of the RadGrid to add validators of your choice. You should follow the steps bellow:

  • Ensure that your are in Insert mode by checking whether the current item is IGridInsertItem;
  • Obtain reference of the respective GridColumnEditor instance and the editing control inside it;
  • Create the validator and set its ControlToValidate property to point to the editing control;
  • Add the validator to the Controls collection of the editing control Parent.

Attached you can find a sample project demonstrating the described validation method.

For additional information on RadGrid validation you can read our help article on this subject :

Best Regards,
Konstantin Dikov
Telerik
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 RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Arun
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or