System.Windows.Forms.TableView.AlignRows C# (CSharp) Method

AlignRows() private method

private AlignRows ( ) : void
return void
        internal void AlignRows()
        {
            int cY = Padding.Top;
            if (topLeftButton != null && columnHeadersHidden == false)
            {
                topLeftButton.Location = new Point(Padding.Left, Padding.Top);
                cY = topLeftButton.Location.Y + topLeftButton.Height + CellPadding;
            }
            for (int i = 0, cellIndex = 1; i < Rows.Count; i++)
            {
                int cX = Padding.Left;

                var row = Rows[i];
                if (rowHeadersHidden == false)
                {
                    row.control.Location = new Point(cX, cY);
                    row.control.Text = (i + 1).ToString();
                    if (topLeftButton != null)
                        row.control.Width = topLeftButton.Width;

                    cX += row.control.Width + CellPadding;
                }

                for (int k = 0; k < row.ItemsControls.Length; k++)
                {
                    var rowIC = row.ItemsControls[k];
                    if (rowIC == null) continue;

                    rowIC.Location = new Point(cX, cY);
                    rowIC.TabIndex = cellIndex;
                    rowIC.Size = new Size(Columns[k].Width, row.Height);

                    cellIndex++;
                    cX += rowIC.Width + CellPadding;
                }

                cY += row.control.Height + CellPadding;
            }

            UpdateScrolls();
        }
        internal void RaiseOnRowClick(TableRow row, MouseEventArgs mArgs)