This question is locked. New answers and comments are not allowed.
Hello,
I have noticed 2 problems with the RadTreeView Accessibility when using the MS-Narrator to read the screen. We are currently using 2011.3 and I am using MS-Narrator for Windows7.
1) Starting in 2011.3, the RadTreeViewItem.AutomationProperties.Name is no longer read correctly. Instead of reading the AutomationProperties.Name that is set in the ItemPrepared event for each RadTreeViewItem, it reads the full type name of the RadTreeViewItem's DataContext (example SilverlightApplication1.Foo). In 2011.2, that was the default behavior, but when I set the AutomationProperties.Name it read the correct text (Foo.Name). This appears to be broken in every version since 2011.2.
2) In all versions of your controls, regardless of the name it reads as described above, it then reads the child count which is always wrong. It is wrong regardless if IsVirtualizing is True or False. If there is not a way for it to read the correct number of children is there a way to make it NOT read the children at all?
I have copied the XAML and code-behind below.
Thanks!
I have noticed 2 problems with the RadTreeView Accessibility when using the MS-Narrator to read the screen. We are currently using 2011.3 and I am using MS-Narrator for Windows7.
1) Starting in 2011.3, the RadTreeViewItem.AutomationProperties.Name is no longer read correctly. Instead of reading the AutomationProperties.Name that is set in the ItemPrepared event for each RadTreeViewItem, it reads the full type name of the RadTreeViewItem's DataContext (example SilverlightApplication1.Foo). In 2011.2, that was the default behavior, but when I set the AutomationProperties.Name it read the correct text (Foo.Name). This appears to be broken in every version since 2011.2.
2) In all versions of your controls, regardless of the name it reads as described above, it then reads the child count which is always wrong. It is wrong regardless if IsVirtualizing is True or False. If there is not a way for it to read the correct number of children is there a way to make it NOT read the children at all?
I have copied the XAML and code-behind below.
Thanks!
XAML:
<
UserControl
x:Class
=
"SilverlightApplication1.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
AutomationProperties.Name
=
""
>
<
UserControl.Resources
>
<
telerik:HierarchicalDataTemplate
x:Key
=
"FooTemplate"
ItemsSource
=
"{Binding Children}"
>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
telerik:HierarchicalDataTemplate
>
</
UserControl.Resources
>
<
Grid
>
<
telerik:RadTreeView
ItemsSource
=
"{Binding Foos}"
ItemTemplate
=
"{StaticResource FooTemplate}"
ItemPrepared
=
"RadTreeView_ItemPrepared"
/>
</
Grid
>
</
UserControl
>
C#:
using System.Collections.ObjectModel;
using System.Windows.Automation;
using System.Windows.Controls;
using Telerik.Windows.Controls;
namespace SilverlightApplication1 {
public partial class MainPage : UserControl {
public MainPage() {
InitializeComponent();
BuildTreeData();
DataContext = this;
}
public ObservableCollection<
Foo
> Foos { get; set; }
//should be read by narrator
void RadTreeView_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e) {
RadTreeViewItem tvi = e.PreparedItem;
if (!(tvi.DataContext is Foo)) return;
tvi.SetValue(AutomationProperties.NameProperty, ((Foo)e.PreparedItem.DataContext).Name);
}
void BuildTreeData(){
//make a family
Foo root = new Foo("Parent");
Foo child1 = new Foo("Child1");
Foo child2 = new Foo("Child2");
Foo child3 = new Foo("Child3");
Foo grandChild1 = new Foo("Grandchild1");
Foo grandChild2 = new Foo("Grandchild2");
Foo grandChild3 = new Foo("Grandchild3");
Foo grandChild4 = new Foo("Grandchild4");
Foo grandChild5 = new Foo("Grandchild5");
Foo grandChild6 = new Foo("Grandchild6");
Foo greatGrandChild1 = new Foo("GreatGrandChild1");
Foo greatGrandChild2 = new Foo("GreatGrandChild2");
Foo greatGrandChild3 = new Foo("GreatGrandChild3");
Foo greatGrandChild4 = new Foo("GreatGrandChild4");
Foo greatGrandChild5 = new Foo("GreatGrandChild5");
Foo greatGrandChild6 = new Foo("GreatGrandChild6");
Foo greatGrandChild7 = new Foo("GreatGrandChild7");
Foo greatGrandChild8 = new Foo("GreatGrandChild8");
Foo greatGrandChild9 = new Foo("GreatGrandChild9");
Foo greatGrandChild10 = new Foo("GreatGrandChild10");
Foo greatGrandChild11 = new Foo("GreatGrandChild11");
Foo greatGrandChild12 = new Foo("GreatGrandChild12");
root.Children.Add(child1);
root.Children.Add(child2);
root.Children.Add(child3);
child1.Children.Add(grandChild1);
child1.Children.Add(grandChild2);
child2.Children.Add(grandChild3);
child2.Children.Add(grandChild4);
child3.Children.Add(grandChild5);
child3.Children.Add(grandChild6);
grandChild1.Children.Add(greatGrandChild1);
grandChild1.Children.Add(greatGrandChild2);
grandChild2.Children.Add(greatGrandChild3);
grandChild2.Children.Add(greatGrandChild4);
grandChild3.Children.Add(greatGrandChild5);
grandChild3.Children.Add(greatGrandChild6);
grandChild4.Children.Add(greatGrandChild7);
grandChild4.Children.Add(greatGrandChild8);
grandChild5.Children.Add(greatGrandChild9);
grandChild5.Children.Add(greatGrandChild10);
grandChild6.Children.Add(greatGrandChild11);
grandChild6.Children.Add(greatGrandChild12);
//populate the collection we are binding to
Foos = new ObservableCollection<
Foo
> { root };
}
}
public class Foo{
public Foo(string name) {
Name = name;
Children = new ObservableCollection<
Foo
>();
}
public string Name { get; set; }
public ObservableCollection<
Foo
> Children { get; set; }
}
}