protected virtual void ArrangeRightToLeftGroupElements( ref PointF current, ref float currentBottom) { GroupElement fromGroupElement = (GroupElement)null; PointF beingPoint = PointF.Empty; PointF endPoint = PointF.Empty; for (int index = 0; index < this.groupElements.Length; ++index) { GroupElement groupElement = this.groupElements[index]; SizeF desiredSize = groupElement.DesiredSize; RectangleF finalRect = new RectangleF(new PointF(current.X - desiredSize.Width, current.Y), desiredSize); groupElement.Arrange(finalRect); currentBottom = Math.Max(currentBottom, current.Y + desiredSize.Height); current.X -= desiredSize.Width + (float)this.ItemsDistance.Width; current.Y += desiredSize.Height + (float)this.ItemsDistance.Height; if (index > 0) { GroupLinkElement groupLink = this.groupLinks[index - 1]; this.CalcFinalRectRightToLeftBottomGroupLink(fromGroupElement, groupElement, out beingPoint, out endPoint); this.ArrangeGroupLink(groupLink, beingPoint, endPoint); } fromGroupElement = groupElement; } }
protected virtual void ArrangeGroupLink( GroupLinkElement linkElement, PointF beginPoint, PointF endPoint) { float width = endPoint.X - beginPoint.X; float height = endPoint.Y - beginPoint.Y; Point point = this.PointFromControl(Point.Ceiling(beginPoint)); SizeF size = new SizeF(width, height); RectangleF finalRect = new RectangleF(new PointF((float)point.X, (float)point.Y), size); linkElement.Arrange(finalRect); }
private void UpdateGroups() { List <GroupElement> groupElementList = new List <GroupElement>(); List <GroupLinkElement> groupLinkElementList = new List <GroupLinkElement>(); for (int index = 0; index < this.template.DataView.GroupDescriptors.Count && this.template.ColumnCount > 0; ++index) { GroupElement groupElement = new GroupElement(this, this.template.DataView.GroupDescriptors[index]); groupElement.UpdateGroupingFields(); if (groupElement.GroupingFieldElements.Count != 0) { groupElementList.Add(groupElement); this.Children.Add((RadElement)groupElement); if (index > 0) { GroupLinkElement groupLinkElement = new GroupLinkElement(this); groupLinkElementList.Add(groupLinkElement); this.Children.Add((RadElement)groupLinkElement); } } } this.groupElements = groupElementList.ToArray(); this.groupLinks = groupLinkElementList.ToArray(); }