Adf.Web.UI.CompoundPanel.ComposeCell C# (CSharp) Method

ComposeCell() private method

private ComposeCell ( System.Web.UI.WebControls.TableItemStyle cellstyle, int width ) : System.Web.UI.HtmlControls.HtmlTableCell
cellstyle System.Web.UI.WebControls.TableItemStyle
width int
return System.Web.UI.HtmlControls.HtmlTableCell
        protected static HtmlTableCell ComposeCell(TableItemStyle cellstyle, int width, params Control[] controls)
        {
            HtmlTableCell cell = null;

            // Some controls are already HtmlTableCell, in which case they should not be encapsulated.
            if (controls.Length == 1)
            {
                cell = controls[0] as HtmlTableCell;
            }

            // If the above is not the case, initialise the HtmlTableCell and add the controls.
            if (cell == null)
            {
                cell = new HtmlTableCell();

                foreach (Control control in controls)
                {
                    cell.Controls.Add(control);
                }
            }

            if (cellstyle != null)
                cell.Attributes["class"] = cellstyle.CssClass;

            cell.Width = width + "%";

            return cell;
        }