Quantcast
Channel: eXpandFramework RSS
Viewing all articles
Browse latest Browse all 861

Minor usability improvement - Nullable values support for boolean property editors

$
0
0
In short, this feature was already supported by the underlying WinForms CheckEdit and ASP.NET ASPxCheckBox controls, but it required writing some custom code in XAF apps. Now this coding is no longer required for XAF users if they need a Nullable<bool> property.

Starting with v16.1.6, the two built-in XAF editors support boolean Nullable properties. In the UI, when the check box is used, nullable properties will be displayed using a third 'grayed' state. When a drop-down editor is used, an empty 'null text' item will be available. Technically, the PropertyEditor.AllowNull must return True for the aforementioned UI transformations to take effect.

Please see the following code examples and screenshots for more details:

        public bool? ThreeStateCheckBox {
            get;set;
        }
        [CaptionsForBoolValues("Checked", "Unchecked")]
        public bool? ThreeStateDropDown {
            get;set;
        }


Web

Windows





Note that we have not polluted the Application Model with the new CaptionForEmpty/ImageForEmpty options to customize an caption and image for an empty item in 'drop down' mode respectively. In WinForms, it is just an empty string while in ASP.NET it is a familiar 'N/A', which is derived from the PropertyEditor.NullText or the Localization | Texts | NullValueText node in the Application Model. If you want to have this as well, please provide us with screenshots showing specific use-case scenarios where it can be helpful for your business. With that, we will be in a better position to evaluate any future improvements in this regard.

As always, my team and I are looking forward to hearing from you. Thanks in advance!

Viewing all articles
Browse latest Browse all 861

Trending Articles