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

[Solved] How to validate duplicate items in a batch editing grid.

1 Answer 187 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.
Oscar
Top achievements
Rank 1
Oscar asked on 27 Jan 2012, 11:12 AM
Hello Telerik:
Do you have any sample where the new rows inserted by the user have a 'exists' rule validation to prevent duplicate items in a batch editing grid?
Thank you.
Oscar.

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 31 Jan 2012, 04:54 PM
Hi Oscar,

 We don't have such example, but this is a general case, that is not directly related to the Grid component and should be handled by custom user code. Basically, what you need to do is to implement a custom check in the save action (_SaveBatchEditing in the demo) and in case of a problem like a duplicate item, to raise  ModelState error. The function hooked to the Grid's OnError event will display that error to the user.


All the best,
Georgi Tunev
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
Tags
Grid
Asked by
Oscar
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or