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 internal void UpdateColumns() { for (int i = 0; i < fRootBand.Width; i++) { TreeListColumn Col = fRootBand.GetColumn(i); if (Col != null) { Col.VisibleIndex = (Col.Visible) ? fRootBand.IndexToColumnHandle(i) : -1; } } }
public TreeListColumn GetColumn(int Index) { if ((Index >= 0) && (Index < Width)) { int Handle = IndexToColumnHandle(Index); MyTreeListBand Child = Children.FindAtHandle(Handle); if (Child == null) { return(Columns[Index]); } else { return(Child.GetColumn(Child.ColumnHandleToIndex(Handle))); } } return(null); }