protected override SizeF EndMeasure()
        {
            SizeF empty = SizeF.Empty;
            PinnedColumnTraverser dataProvider = this.DataProvider as PinnedColumnTraverser;
            SizeF sizeF;

            if (!this.ScrollColumns && dataProvider != null)
            {
                sizeF = this.Context.TableElement.ViewElement.RowLayout.MeasurePinnedColumns(dataProvider);
            }
            else
            {
                sizeF       = this.Context.TableElement.ViewElement.RowLayout.DesiredSize;
                sizeF.Width = Math.Min(this.availableSize.Width, sizeF.Width);
            }
            if (!this.Context.TableElement.GridViewElement.AutoSizeRows)
            {
                return(new SizeF(sizeF.Width, this.availableSize.Height));
            }
            ColumnGroupRowLayout rowLayout = this.context.TableElement.ViewElement.RowLayout as ColumnGroupRowLayout;

            if (rowLayout != null)
            {
                this.desiredSize.Height = rowLayout.MeasureAutoSizeRow(this.Children);
            }
            return(new SizeF(sizeF.Width, this.desiredSize.Height));
        }
Beispiel #2
0
        public virtual SizeF MeasurePinnedColumns(PinnedColumnTraverser dataProvider)
        {
            SizeF empty = SizeF.Empty;
            int   num   = 0;
            CellElementProvider elementProvider = this.Owner.ColumnScroller.ElementProvider as CellElementProvider;

            foreach (GridViewColumn gridViewColumn in (ItemsTraverser <GridViewColumn>)dataProvider)
            {
                empty.Width += elementProvider.GetElementSize(gridViewColumn).Width;
                ++num;
            }
            if (num > 0)
            {
                empty.Width += (float)((num - 1) * this.Owner.CellSpacing);
            }
            return(empty);
        }
Beispiel #3
0
        public override SizeF MeasurePinnedColumns(PinnedColumnTraverser dataProvider)
        {
            SizeF sizeF = new SizeF(0.0f, this.desiredSize.Height);
            float val1  = float.MaxValue;

            foreach (GridViewColumn column in (ItemsTraverser <GridViewColumn>)dataProvider)
            {
                ColumnGroupsCellArrangeInfo columnData = this.GetColumnData(column);
                if (columnData != null)
                {
                    sizeF.Width = Math.Max(sizeF.Width, (float)(int)columnData.Bounds.Right);
                    val1        = Math.Min(val1, columnData.Bounds.X);
                }
            }
            if ((double)val1 != 3.40282346638529E+38)
            {
                sizeF.Width -= val1;
            }
            if (dataProvider.PinPosition == PinnedColumnPosition.Right)
            {
                sizeF.Width -= (float)this.Owner.CellSpacing;
            }
            return(sizeF);
        }