Example #1
0
            /// <summary>
            /// When implemented by a class, defines the <see cref="T:System.Web.UI.Control" /> object that child controls and templates belong to. These child controls are in turn defined within an inline template.
            /// </summary>
            /// <param name="container">The <see cref="T:System.Web.UI.Control" /> object to contain the instances of controls from the inline template.</param>
            public void InstantiateIn(Control container)
            {
                DataControlFieldCell cell = container as DataControlFieldCell;

                this.MergePersonField = cell.ContainingField as MergePersonField;

                Panel selectionControlContainer = new Panel {
                    ID = $"selectionControlContainer_{MergePersonField.PersonId}", CssClass = "js-selection-control-container selection-control-container",
                };

                cell.Controls.Add(selectionControlContainer);

                RockCheckBox selectionControlCheckbox = new RockCheckBox
                {
                    ID       = $"selectionControlCheckbox_{MergePersonField.PersonId}",
                    CssClass = "js-selection-control selection-control"
                };

                selectionControlCheckbox.Attributes["data-person-id"] = MergePersonField.PersonId.ToString();
                selectionControlContainer.Controls.Add(selectionControlCheckbox);

                RockRadioButton selectionControlRadioButton = new RockRadioButton
                {
                    ID       = $"selectionControlRadioButton_{MergePersonField.PersonId}",
                    CssClass = "js-selection-control selection-control"
                };

                selectionControlRadioButton.Attributes["data-person-id"] = MergePersonField.PersonId.ToString();
                selectionControlContainer.Controls.Add(selectionControlRadioButton);

                Literal contentHtmlLiteral = new Literal {
                    ID = $"contentHtmlLiteral_{MergePersonField.PersonId}"
                };

                cell.Controls.Add(contentHtmlLiteral);

                cell.CssClass = "js-merge-field-cell merge-field-cell";

                cell.DataBinding += cell_DataBinding;
                cell.Load        += cell_Load;
            }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MergePersonFieldRowEventArgs"/> class.
 /// </summary>
 /// <param name="row">The row.</param>
 /// <param name="mergePersonField">The merge person field.</param>
 public MergePersonFieldRowEventArgs(GridViewRow row, MergePersonField mergePersonField) : base(row)
 {
     MergePersonField = mergePersonField;
 }