Пример #1
0
 protected override void CreateChildElements()
 {
     this.stack = new StackLayoutElement();
     this.stack.FitInAvailableSize       = true;
     this.stack.StretchHorizontally      = true;
     this.stack.StretchVertically        = true;
     this.stack.NotifyParentOnMouseInput = true;
     this.stack.ShouldHandleMouseInput   = false;
     this.stack.FitToSizeMode            = RadFitToSizeMode.FitToParentBounds;
     this.headerElement   = this.CreatePropertyGridRowHeaderElement();
     this.indentElement   = this.CreatePropertyGridIndentElement();
     this.expanderElement = this.CreatePropertyGridExpanderElement();
     this.textElement     = this.CreatePropertyGridTextElement();
     this.valueElement    = this.CreatePropertyGridValueElement();
     this.stack.Children.Add((RadElement)this.headerElement);
     this.stack.Children.Add((RadElement)this.indentElement);
     this.stack.Children.Add((RadElement)this.expanderElement);
     this.stack.Children.Add((RadElement)this.textElement);
     this.stack.Children.Add((RadElement)this.valueElement);
     this.Children.Add((RadElement)this.stack);
 }
        public override AccessibleObject HitTest(int x, int y)
        {
            RadElement elementAtPoint = this.Control.RootElement.ElementTree.GetElementAtPoint(this.Control.PointToClient(new Point(x, y)));

            if (elementAtPoint == null)
            {
                return(base.HitTest(x, y));
            }
            PropertyGridTextElement ancestor1 = elementAtPoint.FindAncestor <PropertyGridTextElement>();

            if (ancestor1 != null)
            {
                return((AccessibleObject) new PropertyGridCellAccessibleObject(ancestor1.Text, (PropertyGridItemBaseAccessibleObject)this));
            }
            PropertyGridValueElement ancestor2 = elementAtPoint.FindAncestor <PropertyGridValueElement>();

            if (ancestor2 != null)
            {
                return((AccessibleObject) new PropertyGridCellAccessibleObject(((PropertyGridItem)ancestor2.VisualItem.Data).FormattedValue, (PropertyGridItemBaseAccessibleObject)this));
            }
            return(base.HitTest(x, y));
        }