/// <summary>
        /// Creates the HTML controls required to configure this type of field
        /// </summary>
        /// <returns></returns>
        public override List<Control> ConfigurationControls()
        {
            var controls = base.ConfigurationControls();

            // build a drop down list of group types (the one that gets selected is
            // used to build a list of group location type defined values that the
            // group type allows) 
            var ddl = new RockDropDownList();
            controls.Add( ddl );
            ddl.AutoPostBack = true;
            ddl.SelectedIndexChanged += OnQualifierUpdated;
            ddl.Label = "Group Type";
            ddl.Help = "The Group Type to select location types from.";

            Rock.Model.GroupTypeService groupTypeService = new Model.GroupTypeService( new RockContext() );
            foreach ( var groupType in groupTypeService.Queryable().OrderBy( g => g.Name ) )
            {
                ddl.Items.Add( new ListItem( groupType.Name, groupType.Guid.ToString() ) );
            }

            return controls;
        }
Example #2
0
        /// <summary>
        /// Creates the HTML controls required to configure this type of field
        /// </summary>
        /// <returns></returns>
        public override List <Control> ConfigurationControls()
        {
            var controls = base.ConfigurationControls();

            // build a drop down list of group types (the one that gets selected is
            // used to build a list of group location type defined values that the
            // group type allows)
            var ddl = new RockDropDownList();

            controls.Add(ddl);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += OnQualifierUpdated;
            ddl.Label = "Group Type";
            ddl.Help  = "The Group Type to select location types from.";

            Rock.Model.GroupTypeService groupTypeService = new Model.GroupTypeService();
            foreach (var groupType in groupTypeService.Queryable().OrderBy(g => g.Name))
            {
                ddl.Items.Add(new ListItem(groupType.Name, groupType.Guid.ToString()));
            }

            return(controls);
        }