This is a migrated thread and some comments may be shown as answers.

RadCheckBox accessibility properties

4 Answers 134 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 29 Aug 2017, 09:00 PM
I'm working on making our application compatible with screen reading software. We have a RadCheckBox control on a form. The control is named chkIncludeInActive, and the text is "Include inactive." When the screen reader is enabled and you hover over the control, it says "Check box include inactive include inactive." This is despite the fact that I've set the "Accessible Description" and "Accessible Name" properties on the control both to "1" (for testing purposes). If I open the Element Hierarchy Editor, and I go to the underlying RadCheckBoxElement, I see the "Accessible Description" and "Accessible Name" are both set as "Include inactive." I can override these values in the Element Hierarchy Editor, but once I open up the form in Design mode again, the defaults are back. So it doesn't seem like these changes stick. I want to be able to override these values somehow and make them stick. The version we're using is 2011.1.11.419.

4 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 30 Aug 2017, 11:12 AM
Hi Joe,

Thank you for writing.

The properties you see using the Element Hierarchy Editor are not serialized and that it is why the value you set cannot be persisted. You can set them at run-time by accessing the ButtonElement property: 
this.radCheckBox1.ButtonElement.AccessibleName = "Accessible Name";
this.radCheckBox1.ButtonElement.AccessibleDescription = "Accessible Description";

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Joe
Top achievements
Rank 1
answered on 30 Aug 2017, 11:26 AM
Thanks for the reply. Hristo, this approach does seem to work, but the LegacyIAccessible.Name and LegacyIAccessible.Description are still being reported as "Include inactive." I think this is because chkIncludeInActive.AccessibilityObject.Description and chkIncludeInActive.AccessibilityObject.Name are still being reported as "Include inactive," and I'm thinking that's where these values are pulled from when read by the screen reader. These values can be seen using the Inspect tool that comes with the Windows SDK. Is there a way to refresh the AccessibilityObject after updating those properties on the ButtonElement?
0
Joe
Top achievements
Rank 1
answered on 30 Aug 2017, 05:46 PM

I have managed to work around this, though it is painful to need to do this. I extended the stock RadCheckBox and RadCheckBoxAccessibleObject classes to conform to what I believe is the correct behavior for these accessibility attributes. To fix the theme of the checkbox, I return the default theme for RadCheckBox. If there is a better way to accomplish this, please let me know.

public class CustomRadCheckBox : RadCheckBox
    {
        protected override AccessibleObject CreateAccessibilityInstance()
        {
            return new CustomRadCheckBoxAccessibleObject(this);
        }
 
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public override string ThemeClassName
        {
            //fixes the theme
            get { return "Telerik.WinControls.UI.RadCheckBox"; }
            set { }
        }
    }
 
    public class CustomRadCheckBoxAccessibleObject : RadCheckBoxAccessibleObject
    {
        public CustomRadCheckBoxAccessibleObject(RadCheckBox owner) : base(owner) { }
 
        public override string Name
        {
            //if not done, the LegacyIAccessible.Name will show as the name of the button
            get { return Owner.AccessibleName; }
            set { }
        }
 
        public override string Description
        {
            //if not done, the LegacyIAccessible.Description will shows as the text of the button
            get { return Owner.AccessibleDescription; }
        }
    }
0
Hristo
Telerik team
answered on 31 Aug 2017, 12:56 PM
Hi Joe,

Thank you for writing back.

Indeed the approach you are using now is valid. You can go ahead and since it fits your local setup use it in your project. Please bear in mind that our MSAA support is primarily developed to handle CodedUI tests and the Windows narrator. In this respect, the inspect or other tools may behave differently.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Joe
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Joe
Top achievements
Rank 1
Share this question
or