Skip to main content
All docs
V24.1

DXAccessible.QueryAccessibleInfoEventArgs.GetDXAccessible<DXAccessible>() Method

Returns a BaseAccessible object (or its descendant) that stores additional accessibility information about the currently processed UI element.

Namespace: DevExpress.Accessibility

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

[EditorBrowsable(EditorBrowsableState.Advanced)]
public DXAccessible GetDXAccessible<DXAccessible>()
    where DXAccessible : BaseAccessible

Type Parameters

Name Description
DXAccessible

The BaseAccessible class descendant.

Returns

Type Description
DXAccessible

The object that stores additional accessibility information about the currently processed UI element.

Remarks

DevExpress controls store accessibility information for their UI elements in BaseAccessible class objects (and their descendants). The GetDXAccessible method allows you to access this object and retrieve additional information about the UI element from this object.

The following example handles the QueryAccessibleInfo event to modify the default value of the AccessibleName setting for cells in DevExpress grid controls. The new value is formed as a column’s caption followed by the “cell” word.

using DevExpress.Accessibility;
using static DevExpress.XtraGrid.Accessibility.GridViewAccessibleObject.GridViewDataPanel;

public Form1() {
    InitializeComponent();
    DXAccessible.QueryAccessibleInfo += DXAccessible_QueryAccessibleInfo;
}

private void DXAccessible_QueryAccessibleInfo(object sender, DXAccessible.QueryAccessibleInfoEventArgs e) {
    if (e.Role == AccessibleRole.Cell) {
        GridCellAccessibleObject cellAccessible = e.GetDXAccessible<GridCellAccessibleObject>();
        if (cellAccessible != null) {
            e.Name = cellAccessible.Column.Caption + " cell";
        }
    }
}
See Also