protected override SizeF MeasureOverride(SizeF availableSize) { SizeF empty = SizeF.Empty; SizeF availableSize1 = this.RestrictChildRowHeight(availableSize); foreach (GridCellElement child in this.Children) { child.Measure(availableSize1); GridDetailViewCellElement detailViewCellElement = child as GridDetailViewCellElement; if (detailViewCellElement != null && detailViewCellElement.ChildTableElement.ViewTemplate.BestFitQueue.Count > 0) { detailViewCellElement.ChildTableElement.BestFitHelper.ProcessRequests(); child.Measure(availableSize1); } if ((double)availableSize1.Width != double.PositiveInfinity) { availableSize1.Width -= child.DesiredSize.Width + (float)this.TableElement.CellSpacing; } empty.Width += child.DesiredSize.Width + (float)this.TableElement.CellSpacing; if (child == detailViewCellElement) { empty.Height = Math.Max(child.DesiredSize.Height, empty.Height); } } empty.Height = Math.Min(availableSize.Height, empty.Height); this.UpdateChildRowHeight((int)empty.Height, availableSize); return(empty); }
public override void Initialize(GridViewRowInfo rowInfo) { base.Initialize(rowInfo); if (this.Children.Count == 0) { this.contentCell = this.CreateCell((GridViewColumn)null) as GridDetailViewCellElement; this.Children.Add((RadElement)this.contentCell); } else { this.contentCell.Initialize((GridViewColumn)null, (GridRowElement)this); } if (this.ViewTemplate.ShowRowHeaderColumn) { foreach (GridViewColumn renderColumn in (IEnumerable <GridViewColumn>) this.TableElement.ViewElement.RowLayout.RenderColumns) { if (renderColumn is GridViewRowHeaderColumn) { if (this.rowHeaderCell == null) { this.rowHeaderCell = (GridRowHeaderCellElement)this.TableElement.CellElementProvider.GetElement(renderColumn, (object)this); this.rowHeaderCell.ThemeRole = "DetailRowHeaderCell"; this.Children.Insert(0, (RadElement)this.rowHeaderCell); } if (this.rowHeaderCell != null) { this.rowHeaderCell.Attach(renderColumn, (object)this); this.rowHeaderCell.Visibility = ElementVisibility.Visible; break; } break; } } } else if (this.rowHeaderCell != null) { this.rowHeaderCell.Visibility = ElementVisibility.Collapsed; } this.contentCell.SetContent(); this.contentCell.UpdateInfo(); GridViewRowInfo currentRow = this.ViewTemplate.MasterTemplate.CurrentRow; if (currentRow == null) { return; } foreach (GridViewInfo childViewInfo in (IEnumerable <GridViewInfo>)(this.RowInfo as GridViewDetailsRowInfo).ChildViewInfos) { if (currentRow.ViewInfo == childViewInfo) { this.GridViewElement.CurrentView = (IRowView)this.contentCell.ChildTableElement; break; } } }
protected GridTableElement GetTableElementAtPoint(Point point) { GridCellElement elementAtPoint = GridVisualElement.GetElementAtPoint <GridCellElement>((RadElementTree)this.GridViewElement.ElementTree, point); GridDetailViewCellElement detailViewCellElement = elementAtPoint as GridDetailViewCellElement; GridTableElement gridTableElement = elementAtPoint?.TableElement; if (detailViewCellElement != null) { gridTableElement = detailViewCellElement.ChildTableElement; } return(gridTableElement ?? this.GridViewElement.TableElement); }