AutomationProperties Accessibility and Narrator in RadTreeView

4 posts, 0 answers
  1. Rich
    Rich avatar
    3 posts
    Member since:
    May 2011

    Posted 13 Apr 2012 Link to this post

    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!
    XAML:
    <UserControl x:Class="SilverlightApplication1.MainPage"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 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; }
        }
    }

     

     

     

     

  2. Stefan
    Admin
    Stefan avatar
    89 posts

    Posted 18 Apr 2012 Link to this post

    Hello Emanuel,

    Thank you for bringing these issues to our attention. I can confirm that they are bugs and I have logged them in our PITS where you can track their progress and vote for them thus increasing their priority. Here you can check the first one and here - the second one. Also as a gratitude for your feedback, I have updated your Telerik points accordingly.

    In the meantime, as a workaround for the first bug, you can override the ToString() method of your business object to return the string you want the narrator to read as the item name. You could also return the  number of children of the business item, but the narrator will still read and the incorrect number of items. Unfortunately we are not aware of any workarounds for this issue.

    Greetings,
    Stefan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Rich
    Rich avatar
    3 posts
    Member since:
    May 2011

    Posted 18 Apr 2012 Link to this post

    Hello Stefan,

    Thank you for your response and for the work around.  I want to better understand the process of getting it fixed.  

    1) I believe we have a valid support contract; would entering a support ticket get any quicker turnaround?

    2) Will the fix untimately be made for Silverlight versions 4 & 5, or would it be faster if we were to upgrade to the Silverlight 5 version of the controls?

    Thanks again!
  5. Stefan
    Admin
    Stefan avatar
    89 posts

    Posted 20 Apr 2012 Link to this post

    Hi Emanuel,

    As you have a valid support subscription, it's best to take advantage of the support ticketing system (http://www.telerik.com/account/support-tickets/new-support-ticket.aspx) in cases when you need a prompt response to urgent issues. This is the best way to reach our support staff - the support system assigns a response time - in your case 24 hours, for all of your questions and ensures that all questions will reach the respective developers, if needed.

    About the fixing process - at the moment we support both Silverlight 4 and 5, which means that fixes are applied for both platforms simultaneously.

    I hope this info helps, but if you have more questions don't hesitate to contact us.

    All the best,
    Stefan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top