public override void CalcColumnInfo(ColumnInfo ci, ref int left, bool customization) { int offset = 0; base.CalcColumnInfo(ci, ref offset, customization); if (ci.Type == ColumnInfo.ColumnInfoType.Column) { MyTreeListBand ParentBand = TreeList.Bands.GetColumnParentBand(ci.Column); if (ParentBand == null) { ci.Bounds = Rectangle.Empty; return; } MyTreeListBandInfo bi = new MyTreeListBandInfo(ParentBand); bi.CalcBandInfo(this); int VisiblePosition = ParentBand.GetColumnIndex(ci.Column); if (ParentBand.BandColumn == ci.Column) { ci.Bounds = bi.Bounds; ci.CaptionRect = new Rectangle(left + 4, 0, bi.Bounds.Width, bi.Bounds.Height); if (BandLinks.ContainsKey(ci.Column)) { BandLinks[ci.Column] = bi; } else { BandLinks.Add(ci.Column, bi); } } else { int X = bi.Bounds.X; for (int i = 0; i < VisiblePosition; i++) { TreeListColumn Col = ParentBand.GetColumn(i); if ((Col != null) && Col.Visible) { X += Col.Width; } } int Y = bi.Bounds.Bottom - 1; int Width = ci.Column.Width; int Height = BandHeight * (BandMaxLevel - ParentBand.Level); ci.Bounds = new Rectangle(X, Y, Width, Height); ci.CaptionRect = new Rectangle(left + 4, 0, Width, Height); ColCount++; left += Width; } } else { left += offset; } UpdateGlyphInfo(ci); ObjectPainter.CalcObjectBounds(GInfo.Graphics, TreeList.ElementsLookAndFeel.Painter.Header, ci); }
protected virtual void CalcBandsInfo() { foreach (MyTreeListBand B in TreeList.Bands) { if ((B.Level > 0) && B.Visible && B.BandColumn == null) { MyTreeListBandInfo bi = new MyTreeListBandInfo(B); bi.CalcBandInfo(this); ColumnsInfo.Columns.Add(bi); } } }