Ticket Q581018
Visible to All Users

ASPxSpinEdit Validation inside ASPxGridView

created 11 years ago

Hello:

I have an ASPxSpinEdit in a ASPxGridView. The ASPxSpinEdit has MinValue of 0 and MaxValue of 10. And the number can have two decimals.

I have noted that if the user puts for example 100 the control put 10 and if the user puts -1 the control put 0.

I want to quit this behavior and if the user puts a wrong value I want to show an error with a red line under the editing row as DevExpress shows when there is an error and also I want to set the ASPxSpinEdit empty and prevent editing row.

I have set the validation expression to the ASPxSpin edit to this one "10|[0-9]{1}((,|.)[0-9]{1,2})? " and I'm performing the ASPxClientEdit.ValidateGroup with JS but it is not working for me.

Thanks for your help. With regards, Tomás

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hello Tomás,
What do you think about using custom validation for the ASPxSpinEdit via javascript code? I think it is the easiest way to accomplish this task. Check the attached example illustrating this approach.
Hope this helps.

    Show previous comments (1)
    DevExpress Support Team 11 years ago

      Hello Tomás,
      If I understood you right, the MinValue and MaxValue properties remain defined. If so, this behavior is correct. If you define MinValue and MaxValue, the input to ASPxSpinEdit is restricted. In this case, validation is redundant. Since you need validation, I recommend you remove definitions of these properties to resolve the problem.
      Thanks,
      Helen

        Hello Helen:
        Thanks for your help. Removing MinValue and MaxValue my Regular Expression is working good.
        And the other question of this topic. Now I'm showing an error in a PopupControl. How can I show the error in a red row under the editing row of the ASPxGridView. I show this when something on the grid fails in a Callback in the default behavior of DevExpress.
        Thanks for your help. With regards, Tomás.

        DevExpress Support Team 11 years ago

          Hello Tomás,
          We avoid discussing several topics in one thread, since it is difficult to follow the conversation. So, I've created a separate ticket for your next question: ASPxGridView - Possible ways of displaying validation messages

          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.