ZForge.Controls.XPTable.Models.ColumnCollection.RecalcWidthCache C# (CSharp) Method

RecalcWidthCache() protected method

Recalculates the total combined width of all columns
protected RecalcWidthCache ( ) : void
return void
        protected internal void RecalcWidthCache()
        {
            int total = 0;
            int visibleWidth = 0;
            int visibleCount = 0;
            int lastVisible = -1;

            for (int i=0; i<this.Count; i++)
            {
                total += this[i].Width;

                if (this[i].Visible)
                {
                    this[i].X = visibleWidth;
                    visibleWidth += this[i].Width;
                    visibleCount++;
                    lastVisible = i;
                }
            }

            this.totalColumnWidth = total;
            this.visibleColumnsWidth = visibleWidth;
            this.visibleColumnCount = visibleCount;
        }