Adf.Web.UI.GridPanel.CreateChildControls C# (CSharp) Метод

CreateChildControls() защищенный Метод

Create the control hierarchy used to render the Adf.Web.UI.SmartPanel control.
protected CreateChildControls ( ) : void
Результат void
        protected override void CreateChildControls()
        {
            var htmlTable = new Table();
            var columnCount = 0;

            foreach (var gridPanelItem in gridPanelItems.Where(gridPanelItem => gridPanelItem.Length > columnCount))
            {
                columnCount = gridPanelItem.Length;
            }

            foreach (var items in gridPanelItems)
            {
                var row = new TableRow();

                foreach (var panelItem in items.Where(panelItem => panelItem.Visible))
                {
                    if (!DesignMode) StyleManager.Style(StyleType.Panel, this);

                    row.CssClass = RowStyle;

                    TableCell cell;

                    if (panelItem.LabelControls != null)
                    {
                        cell = new TableCell {CssClass = LabelCellStyle};
                        if (panelItem.Id != null) cell.ID = "panelLabelItem_" + panelItem.Id;

                        //                        panelItem.LabelControls.CssClass = LabelStyle;
                        foreach (WebControl labelControl in panelItem.LabelControls)
                        {
                            cell.Controls.Add(labelControl);
                        }

                        if (LabelWidth.HasValue)
                            cell.Width = new Unit(LabelWidth.Value, UnitType.Ex);

                        row.Cells.Add(cell);
                    }

                    cell = new TableCell {CssClass = ControlCellStyle};
                    if (panelItem.Id != null) cell.ID = "panelControlItem_" + panelItem.Id;

                    // ColumnSpan: if there are more columns in the grid than items in the row, span the last control over the resting columns
                    if (items[items.Length - 1] == panelItem && items.Length < columnCount)
                    {
                        cell.ColumnSpan = columnCount - items.Length + 2;
                    }
                    // if item has no label, span item over 2 columns
                    if (panelItem.LabelControls == null)
                    {
                        if (cell.ColumnSpan == 0) // not set
                            cell.ColumnSpan = 3;
                        else
                            cell.ColumnSpan++;
                    }

                    foreach (Control control in panelItem.Controls)
                    {
                        cell.Controls.Add(control);
                    }
                    row.Cells.Add(cell);

                    htmlTable.Controls.Add(row);
                }
            }

            htmlTable.CssClass = PanelStyle;

            Controls.Add(htmlTable);
        }