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
1140
CheckEditor.Checked value...
posted

I'm setting the value of a 1 byte Decimal field to the value of the Checkeditor.Checked property.  I was expecting a True value to be a 1...   instead, it's a -1 (negative one).   Is that correct?  I'm new to VB.Net, but in the VB like language I used in the past, True and 1 were synonomous. 

  • 45049
    Verified Answer
    posted

    When WinCheckEditor reads a Decimal value, it'll treat 0 as "false" and any other value as "true."  When it updates the same Decimal value, it'll set the underlying value to 0 for "false" and -1 for "true".  I believe that this might be something handled by the .NET Framework itself, rather than anything we explicitly implemented.

    Whenever possible, I recommend that you use a Boolean value for your underlying data, rather than a Decimal, Double, Integer, String, or other type.  That way, you avoid the need for the editor to perform these kinds of conversions.