Accessibility narrator reading the model class name instead of grid content of WPF application

88 Views Asked by At

In my WPF application, there is a grid view with three columns as Name, City, and Country. Please see the model class:

public class Employee
{
    public string Name { get; set; }
    public string City{ get; set; }
    public string Country{ get; set; }
}

I have added the grid UI like the below code:

<Grid>
      <ListView x:Name="DisplayEmployee">
            <ListView.View>
                <GridView AllowsColumnReorder="False">
                    <GridViewColumn Width="300" DisplayMemberBinding="{Binding Path=Name, Mode=OneWay}">
                        <GridViewColumnHeader Content="{Binding LabelName}"/>
                    </GridViewColumn>
                    <GridViewColumn Width="150" DisplayMemberBinding="{Binding Path=City, Mode=OneWay}">
                        <GridViewColumnHeader Content="{Binding LabelCity}"/>
                    </GridViewColumn>
                    <GridViewColumn Width="150" DisplayMemberBinding="{Binding Path=Country, Mode=OneWay}">
                        <GridViewColumnHeader Content="{Binding LabelStatus}"/>
                    </GridViewColumn>
                </GridView>
            </ListView.View>                
      </ListView>
 </Grid>

The issue is that, when we try to read the grid content using the ZOOM or JAWS accessibility tool, it is reading the corresponding class name Employee instead of the grid content.

When I updated the Employee class like the one below, it is reading properly;

public class Employee
{
    public string Name { get; set; }
    public string City{ get; set; }
    public string Country{ get; set; }
    public override string ToString()
    {
         return Name + " " + City + " " + Country;
    }
}

But I cannot use the string concatenation here. Is there any way to fix this issue by updating the UI element? Any help would be appreciable!

0

There are 0 best solutions below