Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Vaidation for decimal values
posted

I have xamtexteditor. I want to validate the text  for floating point values. I have oracle as backend. So my validation should be like integer part should be 16 digit and decimal part should be 7 digits.(in oracle column is 23,7). How i should validate both integer and fractional part. I am using xamtextbox for style also in the grid. I am not using xamnumericeditor .

Parents
No Data
Reply
  • 27093
    Suggested Answer
    posted

    Hello,

    The XamEditors use the ValueConstraint class to validate the data that is entered. The ValueConstraint implements Regex validation which will look something like this:

    <igEditor:XamTextEditor.ValueConstraint>

    <igEditor:ValueConstraint RegexPattern="\d{16}\.\d{7}" />

    </igEditor:XamTextEditor.ValueConstraint>

    This Regex sets exactly 16 digits and 7 decimal part digits and nothing else. I suggest using this one its a bit more complicated: RegexPattern="\d{1,16}(\.\d{1,7})?" it prevents from enterring morethan the above mentioned digits and also its deciaml part is optional.

    Hope this helps. 

    Sincerely,

    Petar Monov,

    DS Engineer,

    Infragistics Bulgaria

     

Children
No Data