Esempio n. 1
0
        private Rectangle GetScrollableColumnBounds(GridTableElement tableElement)
        {
            PinnedRowsContainerElement     topPinnedRows    = tableElement.ViewElement.TopPinnedRows;
            ScrollableRowsContainerElement scrollableRows   = tableElement.ViewElement.ScrollableRows;
            PinnedRowsContainerElement     bottomPinnedRows = tableElement.ViewElement.BottomPinnedRows;
            RadElement radElement = (RadElement)null;

            if (topPinnedRows.Children.Count > 0)
            {
                radElement = (RadElement)topPinnedRows;
            }
            else if (scrollableRows.Children.Count > 0)
            {
                radElement = (RadElement)scrollableRows;
            }
            else if (bottomPinnedRows.Children.Count > 0)
            {
                radElement = (RadElement)bottomPinnedRows;
            }
            if (radElement == null)
            {
                return(Rectangle.Empty);
            }
            Rectangle boundingRectangle = (radElement.Children[0] as GridVirtualizedRowElement).ScrollableColumns.ControlBoundingRectangle;

            if (tableElement.VScrollBar.Visibility != ElementVisibility.Collapsed)
            {
                boundingRectangle.Width -= tableElement.VScrollBar.ControlBoundingRectangle.Width;
            }
            if (tableElement.HScrollBar.Visibility != ElementVisibility.Collapsed)
            {
                boundingRectangle.Height -= tableElement.HScrollBar.ControlBoundingRectangle.Height;
            }
            return(boundingRectangle);
        }
Esempio n. 2
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            ChildrenChangedEventHandler changedEventHandler = new ChildrenChangedEventHandler(this.rows_ChildrenChanged);

            this.topPinnedRows                  = new PinnedRowsContainerElement();
            this.topPinnedRows.ZIndex           = 10;
            this.topPinnedRows.ChildrenChanged += changedEventHandler;
            this.Children.Add((RadElement)this.topPinnedRows);
            this.scrollableRows = new ScrollableRowsContainerElement();
            this.scrollableRows.ChildrenChanged += changedEventHandler;
            this.Children.Add((RadElement)this.scrollableRows);
            this.bottomPinnedRows                  = new PinnedRowsContainerElement();
            this.bottomPinnedRows.ZIndex           = 5;
            this.bottomPinnedRows.ChildrenChanged += changedEventHandler;
            this.Children.Add((RadElement)this.bottomPinnedRows);
        }