Completed
Last Updated: 18 Jun 2014 08:13 by ADMIN
ADMIN
Jack
Created on: 19 Jul 2012 02:29
Category: UI Framework
Type: Bug Report
0
FIX. there is no narrator indication when using combobox column in RadGridView with narrator or Jaws
1. Create a new project with RadGridView. 2. Add a combobox column. 3. Run the project and run Jaws. 4. Edit the combobox column and change its value. Jaws will not show any indication that the cell value is changed.

We researched this case further and found that the Microsoft Accessibility (etc Jaws) can read only the editors in grid which contains Controls. By default ComboBoxColumn's DropDownStyle property is set DropDownList and in this mode the text box control is hidden cannot be edited. Also, when users using the arrow key for navigation the DropDown pop-up control is not visible etc. in this scenario there is no control which can be read from Jaws.    public class MyDropDownEditorElement : RadItem    {        RadHostItem hostItem;        RadDropDownList dropDownListControl;

        public MyDropDownEditorElement()

        {

            this.dropDownListControl = new RadDropDownList();

            this.dropDownListControl.MinimumSize = new Size(160, 20);

            this.hostItem = new RadHostItem(this.dropDownListControl);

            this.hostItem.MinSize = new Size(160, 20);

            this.Children.Add(this.hostItem);

            this.MinSize = new Size(50, 20);

        }        

        public RadDropDownList DropDownListControl

        {

            get {return this.dropDownListControl;}

        }

        protected override SizeF MeasureOverride(SizeF availableSize)

        {

            this.hostItem.MinSize = availableSize.ToSize();

            this.dropDownListControl.MinimumSize = availableSize.ToSize();

            return base.MeasureOverride(availableSize);

        }

    }

    public class MyDropDownControlEditor : BaseGridEditor

    {

        public override object Value

        {

            get

            {

                RadDropDownListElement editor = (this.EditorElement as MyDropDownEditorElement).DropDownListControl.DropDownListElement;

                if (!string.IsNullOrEmpty(editor.ValueMember))

                {

                    return editor.SelectedValue;

                }

                if (editor.SelectedItem != null)

                {

                    return editor.SelectedItem.Text;

                }

                return editor.Text;

            }

            set

            {

                RadDropDownListElement editor = (this.EditorElement as MyDropDownEditorElement).DropDownListControl.DropDownListElement;

                if (value == null)

                {

                    editor.SelectedItem = null;

                }

                else if (editor.ValueMember == null)

                {

                    editor.SelectedItem = editor.ListElement.Items[editor.FindStringExact(value.ToString())];

                }

                else

                {

                    editor.SelectedValue = value;

                }

            }

        }

        public override void BeginEdit()

        {

            base.BeginEdit();            

            this.EditorElement.Focus();

            GridViewComboBoxColumn column = ((GridViewComboBoxColumn)(((GridComboBoxCellElement)(EditorElement.Parent)).ColumnInfo));

             RadDropDownList element =  ((MyDropDownEditorElement)this.EditorElement).DropDownListControl;      

            if (column.OwnerTemplate != null)

            {

                this.EditorElement.BindingContext = column.OwnerTemplate.BindingContext;

            }

            element.DataSource = null;

            element.FilterExpression = string.Empty;            

            element.ValueMember = column.ValueMember != null ? column.ValueMember : column.DisplayMember;

            element.DisplayMember = column.DisplayMember != null ? column.DisplayMember : column.ValueMember;

            element.DataSource = column.DataSource;

            element.SelectedIndex = -1;

            element.AutoCompleteMode = column.AutoCompleteMode;

            element.DropDownStyle = column.DropDownStyle;

            ((MyDropDownEditorElement)this.EditorElement).DropDownListControl.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownListControl_SelectedIndexChanged);

            ((MyDropDownEditorElement)this.EditorElement).DropDownListControl.BringToFront();

        }

        void DropDownListControl_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)

        {

            OnValueChanged();

        }

        public override bool EndEdit()

        {

            ((MyDropDownEditorElement)this.EditorElement).DropDownListControl.SelectedIndexChanged -= new Telerik.WinControls.UI.Data.PositionChangedEventHandler(DropDownListControl_SelectedIndexChanged);

            return base.EndEdit();

        }

        protected override RadElement CreateEditorElement()

        {

            return new MyDropDownEditorElement();

        }

    }
0 comments