public RowDetailsService(RadDataGrid owner)
            : base(owner)
        {
            this.ExpandedItems = new HashSet <object>();

            this.DetailsPresenter = new DataGridRowDetailsControl();
        }
        private void PrepareExpandedRowDetailsControl(GridRowModel decorator, DataGridRowDetailsControl control)
        {
            if (control != null)
            {
                control.Content = decorator.ItemInfo.Item;

                if (this.owner.RowDetailsTemplate != control.ContentTemplate)
                {
                    control.ContentTemplate = this.owner.RowDetailsTemplate;
                }
            }
        }
Exemple #3
0
        private RadSize MeasureRow(GridRowModel row)
        {
            UIElement container = row.Container as UIElement;

            if (container != null)
            {
                container.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                row.DesiredSize = GridModel.DoubleArithmetics.Ceiling(container.DesiredSize.ToRadSize());
            }

            DataGridRowDetailsControl rowDetailsContainer = row.Container as DataGridRowDetailsControl;

            if (rowDetailsContainer != null)
            {
                row.RowDetailsSize = new RadSize(row.DesiredSize.Width, row.DesiredSize.Height);

                row.DesiredSize = new RadSize(row.DesiredSize.Width, row.DesiredSize.Height);
            }

            var tuple = row.Container as Tuple <UIElement, UIElement>;

            if (tuple != null)
            {
                if (tuple.Item1 != null)
                {
                    tuple.Item1.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                    row.DesiredSize = GridModel.DoubleArithmetics.Ceiling(tuple.Item1.DesiredSize.ToRadSize());
                }

                if (tuple.Item2 != null)
                {
                    tuple.Item2.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                    row.DesiredSize = GridModel.DoubleArithmetics.Ceiling(tuple.Item2.DesiredSize.ToRadSize());
                }
            }

            return(new RadSize(this.lastAvailableSize.Width, row.DesiredSize.Height));
        }
Exemple #4
0
        private Size ArrangeRow(GridRowModel row)
        {
            var arrangeRect = row.layoutSlot;

            DataGridRowDetailsControl rowDetailsContainer = row.Container as DataGridRowDetailsControl;

            if (rowDetailsContainer != null)
            {
                var detailsHeight = rowDetailsContainer.DesiredSize.Height;
                var offset        = double.IsNaN(this.RowHeight) ? (arrangeRect.Height - detailsHeight) : this.RowHeight;

                arrangeRect = new RadRect(arrangeRect.X, arrangeRect.Y + offset, arrangeRect.Width, detailsHeight);
            }

            var container = row.Container as UIElement;

            if (container != null)
            {
                container.Arrange(arrangeRect.ToRect());
            }

            var tuple = row.Container as Tuple <UIElement, UIElement>;

            if (tuple != null)
            {
                if (tuple.Item1 != null)
                {
                    tuple.Item1.Arrange(arrangeRect.ToRect());
                }

                if (tuple.Item2 != null)
                {
                    tuple.Item2.Arrange(arrangeRect.ToRect());
                }
            }

            return(new Size(arrangeRect.Width, arrangeRect.Height));
        }