Adf.Web.UI.RowSelectorColumn.InitializeCell C# (CSharp) Метод

InitializeCell() приватный Метод

private InitializeCell ( System.Web.UI.WebControls.DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex ) : void
cell System.Web.UI.WebControls.DataControlFieldCell
cellType DataControlCellType
rowState DataControlRowState
rowIndex int
Результат void
        public override void InitializeCell(DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
        {
            base.InitializeCell(cell, cellType, rowState, rowIndex);

            switch (rowState)
            {
                case DataControlRowState.Edit:
                case DataControlRowState.Normal:
                case DataControlRowState.Alternate:
                case DataControlRowState.Selected:

                    if (SelectionMode == ListSelectionMode.Multiple)
                    {
                        ParticipantCheckBox selector = new ParticipantCheckBox();
                        selector.ID = "RowSelectorColumnSelector";
                        selector.AutoPostBack = AutoPostBack;
                        cell.Controls.Add(selector);
                        if (AllowSelectAll)
                        {
                            RegisterForSelectAll(selector);
                        }
                        selector.ServerChange += new EventHandler(selector_ServerChange);
                    }
                    else
                    {
                        ParticipantRadioButton selector = new ParticipantRadioButton();
                        selector.Name = "RowSelectorColumnSelector";
                        selector.ID = "RowSelectorColumnSelector";
                        selector.AutoPostBack = AutoPostBack;
                        cell.Controls.Add(selector);
                        selector.DataBinding += new EventHandler(selectorDataBinding);
                        selector.ServerChange += new EventHandler(selector_ServerChange);
                    }
                    break;
            }

            if (cellType == DataControlCellType.Header)
            {
                if (AllowSelectAll && SelectionMode == ListSelectionMode.Multiple)
                {
                    selectAllControl = new SelectAllCheckBox();
                    selectAllControl.ID = "RowSelectorColumnAllSelector";
                    selectAllControl.AutoPostBack = AutoPostBack;
                    RegisterSelectAllScript();

                    String currentText = (cell == null) ? "" : cell.Text;
                    if (!string.IsNullOrEmpty(currentText))
                    {
                        cell.Text = "";
                    }
                    cell.Controls.Add(selectAllControl);
                    if (!string.IsNullOrEmpty(currentText))
                    {
                        cell.Controls.Add(new LiteralControl(currentText));
                    }
                }
            }
        }