Esempio n. 1
0
        internal void UpdateEditRow(ItemInfo info, RadPoint startPosition, bool hasFrozenColumns)
        {
            this.renderInfo.Update(0, startPosition.Y);

            if (!this.initialized)
            {
                this.initialized = true;

                var editRow = this.GetDecorator(new RowGenerationContext(info, false));

                editRow.ItemInfo = new ItemInfo {
                    Item = info.Item, Slot = 1
                };
                editRow.ReadOnlyRowInfo = info;

                this.EditRow = editRow;

                var frozenEditRow = this.GetFrozenDecorator(new RowGenerationContext(info, true));

                frozenEditRow.ItemInfo = new ItemInfo {
                    Item = info.Item, Slot = 1
                };
                frozenEditRow.ReadOnlyRowInfo = info;

                this.FrozenEditRow = frozenEditRow;
            }

            this.generator.PrepareContainerForItem(this.EditRow);
            var size   = this.table.Measure(this.EditRow);
            var height = this.table.GenerateCellsForRow(1, size.Height, this.EditRow);

            // var frozenHeight = this.table.GenerateCellsForRow(1, frozenSize.Height, this.FrozenEditRow);
            // var updatedHeight = Math.Max(height, frozenHeight);
            var updatedHeight = height;

            this.renderInfo.Update(1, updatedHeight);

            this.EditRow.DesiredSize = new RadSize(size.Width, updatedHeight);
            this.EditRow.layoutSlot  = new RadRect(startPosition.X, startPosition.Y, this.EditRow.DesiredSize.Width, this.EditRow.DesiredSize.Height);

            this.generator.PrepareContainerForItem(this.FrozenEditRow);
            var frozenSize = this.table.Measure(this.FrozenEditRow);

            this.FrozenEditRow.DesiredSize = new RadSize(size.Width, updatedHeight);
            this.FrozenEditRow.layoutSlot  = new RadRect(startPosition.X, startPosition.Y, this.FrozenEditRow.DesiredSize.Width, this.FrozenEditRow.DesiredSize.Height);

            if (!hasFrozenColumns)
            {
                this.generator.MakeHidden(this.FrozenEditRow);
            }

            this.displayedElement = new KeyValuePair <int, List <GridRowModel> >(1, new List <GridRowModel> {
                this.EditRow, this.FrozenEditRow
            });
        }
Esempio n. 2
0
 private void RecycleFrozenEditRow()
 {
     if (this.FrozenEditRow != null)
     {
         this.generator.ClearContainerForItem(this.FrozenEditRow);
         this.generator.MakeHidden(this.FrozenEditRow);
         this.frozenRecycledRow = this.FrozenEditRow;
         this.FrozenEditRow     = null;
         this.RefreshRenderInfo(this.table.RowHeight);
     }
 }
Esempio n. 3
0
        private GridEditRowModel GetDecorator(RowGenerationContext context)
        {
            GridEditRowModel row;

            if (this.recycledRow != null)
            {
                row = this.recycledRow;
                this.generator.MakeVisible(row);
                this.recycledRow = null;
            }
            else
            {
                row = new GridEditRowModel();
                var containerType = this.generator.GetContainerTypeForItem(context);
                row.Container = this.generator.GenerateContainerForItem(context, containerType);

                row.ContainerType = containerType;
            }

            return(row);
        }
Esempio n. 4
0
        void IGridView.Arrange(Node node)
        {
            GridEditRowModel editRow = node as GridEditRowModel;

            if (editRow != null)
            {
                this.ArrangeEditRow(editRow);
                return;
            }

            GridRowModel row = node as GridRowModel;

            if (row != null)
            {
                RadDataGrid.ArrangeRow(row);
                return;
            }

            GridHeaderCellModel headerCell = node as GridHeaderCellModel;

            if (headerCell != null)
            {
                this.ArrangeHeaderCell(headerCell);
                return;
            }

            GridCellEditorModel editCell = node as GridCellEditorModel;

            if (editCell != null)
            {
                this.ArrangeEditorCell(editCell);
            }

            GridCellModel cell = node as GridCellModel;

            if (cell != null)
            {
                this.ArrangeCell(cell);
            }
        }
Esempio n. 5
0
        internal RadRect InflateEditRowVertically(GridEditRowModel row, RadRect rect)
        {
            // the editrow uses the size of the row behind it(which has already been precalculated in the EditRowHostPanel and takes into acount the gridlines(if any).
            if (row != null && this.decorationLayerCache != null)
            {
                var line         = row.ReadOnlyRowInfo.LayoutInfo.Line;
                var visibleLines = this.Model.RowPool.Layout.VisibleLineCount;
                var height       = 0d;

                var element = this.Model.RowPool.GetDisplayedElement(line + 1);

                if (element != null && line != visibleLines - 1 && this.HasHorizontalGridLines && element.ContainerType != typeof(DataGridGroupHeader))
                {
                    height += this.GridLinesThickness;
                }

                var layoutSlot  = this.Model.RowPool.GetDisplayedElement(line).LayoutSlot;
                var arrangeRect = new RadRect(rect.X, rect.Y, rect.Width, layoutSlot.Height + height);

                return(arrangeRect);
            }

            return(rect);
        }
Esempio n. 6
0
 private void ArrangeEditRow(GridEditRowModel row)
 {
     this.EditRowLayer.ArrangeEditRow(row);
 }