Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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