Ticket Q405205
Visible to All Users

GridView - How to use Microsoft validation with an AJAX form to validate the Model properties on the client side

created 13 years ago

Hello kind sirs,

Im using your grid within my mvc web project, which validation is based on microsofts data annotations validation.

Everything works great within standart edit forms, where im using your mc editor extensions, and +- (except for remote validation) can make everything work as expected.

This, however, is not the situation with the mvc grid extension. I checked the "showmodelerrors" property, but the grid postbacks to the server without ever checking the validation on client side. eventually it fails on the server, and i see the model errors nearby the relevant editors.

I'd expect the inline editing to work exactly as every other form, and the client validation to get executed as well, howeever this is not the case. I didnt find any relevan information about this anywhere.

Thanks for your help.

Answers

created 13 years ago (modified 13 years ago)

Hello Roni,
I refer you to the following examples that demonstrate how to use standard validation mechanisms with our GridView:
How to use Microsoft validation with an AJAX form to validate the Model properties on the client side How to enable unobtrusive validation for GridView using the EditForm template
GridView - EditForm template - How to enable Microsoft MVC validation
How to use jQuery validation (StringLength, Required, Range, RegularExpression attributes)
I have also attached a sample project based on the GridView - How to edit in memory data source demo. There is GridView with Inline data editing in the project. Monel and Unobtrusive validations do not work on the client side with a default Edit Form. If you are using a default Edit Form and it is necessary to validate a column editor, I recommend you use a built-in validation.

    Show previous comments (6)
    DevExpress Support Team 13 years ago

      It is impossible to install several minor versions on the same machine. You can have different major versions, however it is impossible to use them in the same project.

        Hi, maybe im missing something. In the video you sent to me, we can see a working validation, but since you aren ot debugging, theres no way to tell whether its the client or the server validation. The server validation works fine, but i dont want the request to get to server at first place if the client side validation fails, and it doensnt work/cant be seen from your movie. As of a sample project - it doesnt work in the sample project you provided to me

        DevExpress Support Team 13 years ago

          We have performed an additional investigation. For now, Monel and Unobtrusive validations do not work on the client side with a default Edit Form. If you are using a default Edit Form and it is necessary to validate a column editor, I recommend you use a built-in validation.
          I have also updated my Answer.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.