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

custom validation

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 08 Dec 2011, 07:37 PM
How do I use a customValidator With RadGrdi to validate ALL of the editable fields in a grid when in-line editing is used. In such a case, I don't set ControlToValidate in the CustomValidator, so in my ServerValidate Event, I don't know how to obtain the values being updated. The example shown in

http://www.telerik.com/help/aspnet-ajax/grid-validation.html

only pertains to validating a single field.

Private Sub custVal_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles custVal.ServerValidate
            args.IsValid = ValidatedConfiguration()
        End Sub
 
Private Sub ValidatedConfiguration()
' How do I access the updated values here?
End Function

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 13 Dec 2011, 05:07 PM
Hi Albert,

To be able to use the same validator for any and all editable items, you would best define it outside the grid. Then on its ServerValidate event, loop through the grid edited items (use EditItems or EditIndexes collection) and validate the input by accessing the editors for the desired fields and checking their value for instance.

Let me know if this helps or I missed something out.

All the best,
Iana Tsolova
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Iana Tsolova
Telerik team
Share this question
or