This question is locked. New answers and comments are not allowed.
I'm working with Q1 2011 release 05/17/2011
Run the official demo, click Grid -> RAZOR -> Editing -> Batch Editing -> Add new record
Then the "Product name" column shows a edit box, you must enter something to pass the required validation, everything seems working fine. but... It is not real.
Change the "EditingBatch.cshtml" file in the "Razor" area. Make the "UnitPrice" column as the first column like below:
re-Run the demo, click Grid -> RAZOR -> Editing -> Batch Editing -> Add new record
Then the "Unit price" column shows a edit box, you just do not enter anything, click the "Save changes" button on the tool bar of the grid, you will post back the new blank row to the server side, then the error prompt shows, you meet a validate error: the Product name is required. everything seems working fine. but... It is not real.
If you click the column header of the "Unit price" column to sort all rows, you will see the blank row has been accepted and "saved" to the data store.
By tracking the error information sent from server, I found the model state error prompt was coming with, and at the end of the data records.
Please advise if it is a bug, and how to apply server side validation and send back the error information to the client by JSON.
Also please forgive my poor english, :)
Thanks
Henry
Run the official demo, click Grid -> RAZOR -> Editing -> Batch Editing -> Add new record
Then the "Product name" column shows a edit box, you must enter something to pass the required validation, everything seems working fine. but... It is not real.
Change the "EditingBatch.cshtml" file in the "Razor" area. Make the "UnitPrice" column as the first column like below:
.Columns(columns =>{ columns.Bound(p => p.UnitPrice).Width(130).Format("{0:c}"); columns.Bound(p => p.ProductName).Width(210);re-Run the demo, click Grid -> RAZOR -> Editing -> Batch Editing -> Add new record
Then the "Unit price" column shows a edit box, you just do not enter anything, click the "Save changes" button on the tool bar of the grid, you will post back the new blank row to the server side, then the error prompt shows, you meet a validate error: the Product name is required. everything seems working fine. but... It is not real.
If you click the column header of the "Unit price" column to sort all rows, you will see the blank row has been accepted and "saved" to the data store.
By tracking the error information sent from server, I found the model state error prompt was coming with, and at the end of the data records.
Please advise if it is a bug, and how to apply server side validation and send back the error information to the client by JSON.
Also please forgive my poor english, :)
Thanks
Henry