开发者

On Edit Grid view Multiple row edit validation

开发者 https://www.devze.com 2022-12-19 00:56 出处:网络
I am using a telerik radgrid so the开发者_JAVA技巧re are around 5 columns each column edittemplate contains a control along with a required field validator and also a property called AllowMultiRowEdit

I am using a telerik radgrid so the开发者_JAVA技巧re are around 5 columns each column edittemplate contains a control along with a required field validator and also a property called AllowMultiRowEdit is set to true so i am able to multiple rows in edit mode.

If any of the values are cleared the for multiple rows I want only those to be validated on update of that particular row.

So i implemented the Grids item data bound event find each and every validator along with the update button and set a unique validation group.

The above implementation most times but fails at some time. Is there any other way of going about this ?


You could use a customvalidator that uses code to check the other textboxes to ensure no value is being updated... requiredfieldvalidator always validates that a value has been supplied in the database, but CustomValidator gives you the ability to control the validation on the client and server. The issue becomes though, how to validate the other controls, and that will be tricky.

You will have to, from within the servervalidate or on the client, navigate up the control hierarchy from the validated control to the row level of the control and then find the other controls in the same row.

0

精彩评论

暂无评论...
验证码 换一张
取 消