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

[Solved] Cross Field Validation?

1 Answer 137 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Panya Thanyaprasertkul
Top achievements
Rank 1
Panya Thanyaprasertkul asked on 30 Jul 2009, 03:16 AM
Hi there,

I'm just evaluating Rad Controls for ASP.NET
I have some question about validation model in RadGrid.
Does it offer something richer than ASP.NET style validation?
I think ASP.NET validation does not answer the real-life applcation.
You just don't validate that this field should less than this or that.
In real application we sometimes need to validate data cross fields
and under some certain conditions.
I see in the Validation section of RadGrid in Demo and found that
you just use System.Web.UI.WebControls.ServerValidateEventArgs class
which is too lame to me. Is there another validation model to use than that.
Or we just need to code a sequence of IF THEN ELSEIF to validate data item
on Insert, Update, DeleteCommand?

Thanks
Panya

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 05 Aug 2009, 06:07 AM
Hi Panya,

Basically, there is no other form/model for validation. Especially for complex scenarios with cross field validation. With the grid control, you have two options.
You can either attach to the ItemCommand event handler of the control, and intercept the new values as the user triggers the commands. Or, you can add validators to the grid edit form. This can be done either declaratively, or dynamically.
These approaches cover all possible scenarios, and I hope one of them is suitable for you.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Panya Thanyaprasertkul
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or