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
560
When and where to convert numeric data to display in a WinCheckEditor
posted

Hello all,

We have an UltraCheckEditor on a form that needs to be bound to numeric data. The data contains all zeroes and ones, but we do not control the data and therefore cannot change it to a bit column. Where do I place code to convert the underlying data into a boolean value so that it can be displayed in the checkbox? Also, where do I place code to update the underlying data when the user checks/unchecks the checkbox? Thanks!

  • 17259
    Offline posted

    Add your own class and bind its property.

    public class MyData

    {

    private RealData realData;

    public bool BooleanField

    {

    get { return realData.intProperty > 5 ? true : false;}

    set { realData.intProperty = (value == true? 1 : 0); }

    }

    }