コード例 #1
0
        /// <summary>
        /// Initializes the data cell.
        /// </summary>
        /// <param name="cell"></param>
        protected virtual void InitializeDataCell(DataControlFieldCell cell)
        {
            Control selector = null;

            if (this.SelectionMode == ListSelectionMode.Multiple)
            {
                CheckBox cb = new CheckBox();
                this.selectAll.RegisterParticipant(cb);
                cb.AutoPostBack    = this.AutoPostBack;
                cb.CheckedChanged += new EventHandler(this.selector_CheckedChanged);
                cb.DataBinding    += new EventHandler(this.selector_DataBinding);
                selector           = cb;
            }
            else
            {
                GridViewRadioButton rb = new GridViewRadioButton();
                rb.AutoPostBack  = this.AutoPostBack;
                rb.ServerChange += new EventHandler(this.selector_CheckedChanged);
                rb.Name          = "RowSelector";
                rb.DataBinding  += new EventHandler(this.selector_DataBinding);
                selector         = rb;
            }

            cell.Controls.Add(selector);
        }
コード例 #2
0
ファイル: RowSelectorField.cs プロジェクト: dblock/sncore
        /// <summary>
        /// Initializes the data cell.
        /// </summary>
        /// <param name="cell"></param>
        protected virtual void InitializeDataCell(DataControlFieldCell cell)
        {
            Control selector = null;
            if (this.SelectionMode == ListSelectionMode.Multiple)
            {
                CheckBox cb = new CheckBox();
                this.selectAll.RegisterParticipant(cb);
                cb.AutoPostBack = this.AutoPostBack;
                cb.CheckedChanged += new EventHandler(this.selector_CheckedChanged);
                cb.DataBinding += new EventHandler(this.selector_DataBinding);
                selector = cb;
            }
            else
            {
                GridViewRadioButton rb = new GridViewRadioButton();
                rb.AutoPostBack = this.AutoPostBack;
                rb.ServerChange += new EventHandler(this.selector_CheckedChanged);
                rb.Name = "RowSelector";
                rb.DataBinding += new EventHandler(this.selector_DataBinding);
                selector = rb;
            }

            cell.Controls.Add(selector);
        }