当前位置: 首页>>代码示例>>C#>>正文


C# RockDropDownList.AddCssClass方法代码示例

本文整理汇总了C#中Rock.Web.UI.Controls.RockDropDownList.AddCssClass方法的典型用法代码示例。如果您正苦于以下问题:C# RockDropDownList.AddCssClass方法的具体用法?C# RockDropDownList.AddCssClass怎么用?C# RockDropDownList.AddCssClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rock.Web.UI.Controls.RockDropDownList的用法示例。


在下文中一共展示了RockDropDownList.AddCssClass方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FilterValueControl

        /// <summary>
        /// Gets the filter value control.
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="required">if set to <c>true</c> [required].</param>
        /// <param name="filterMode">The filter mode.</param>
        /// <returns></returns>
        public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required, FilterMode filterMode )
        {
            var ddlList = new RockDropDownList();
            ddlList.ID = string.Format( "{0}_ddlList", id );
            ddlList.AddCssClass( "js-filter-control" );

            if ( !required )
            {
                ddlList.Items.Add( new ListItem() );
            }

            if ( ListSource.Any() )
            {
                foreach ( var item in ListSource )
                {
                    ListItem listItem = new ListItem( item.Value, item.Key );
                    ddlList.Items.Add( listItem );
                }

                return ddlList;
            }

            return null;
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:32,代码来源:SelectFromListFieldType.cs

示例2: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes );
            ddlIntegerCompare.Label = "Count";
            ddlIntegerCompare.ID = string.Format( "{0}_ddlIntegerCompare", filterControl.ID );
            ddlIntegerCompare.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlIntegerCompare );

            var nbMemberCount = new NumberBox();
            nbMemberCount.Label = "&nbsp;";
            nbMemberCount.ID = string.Format( "{0}_nbMemberCount", filterControl.ID );
            nbMemberCount.AddCssClass( "js-filter-control js-member-count" );
            nbMemberCount.FieldName = "Member Count";
            filterControl.Controls.Add( nbMemberCount );

            RockDropDownList ddlLeader = new RockDropDownList();
            ddlLeader.ID = string.Format( "{0}_ddlMemberType", filterControl.ID );
            ddlLeader.AddCssClass( "js-filter-control js-member-is-leader" );
            ddlLeader.Label = "Member Type";
            ddlLeader.Items.Add( new ListItem( string.Empty, string.Empty ) );
            ddlLeader.Items.Add( new ListItem( "Leader", "true" ) );
            ddlLeader.Items.Add( new ListItem( "Not Leader", "false" ) );
            filterControl.Controls.Add( ddlLeader );
            ddlLeader.Style[HtmlTextWriterStyle.Display] = this.SimpleMemberCountMode ? "none" : string.Empty;

            RockDropDownList ddlMemberStatus = new RockDropDownList();
            ddlMemberStatus.ID = string.Format( "{0}_ddlMemberStatus", filterControl.ID );
            ddlMemberStatus.AddCssClass( "js-filter-control js-member-status" );
            ddlMemberStatus.Label = "Member Status";
            ddlMemberStatus.Items.Add( new ListItem( string.Empty, string.Empty ) );
            foreach ( GroupMemberStatus memberStatus in Enum.GetValues( typeof( GroupMemberStatus ) ) )
            {
                ddlMemberStatus.Items.Add( new ListItem( memberStatus.ConvertToString(), memberStatus.ConvertToInt().ToString() ) );
            }

            filterControl.Controls.Add( ddlMemberStatus );

            ddlLeader.Visible = !this.SimpleMemberCountMode;
            ddlMemberStatus.Visible = !this.SimpleMemberCountMode;

            return new Control[] { ddlIntegerCompare, nbMemberCount, ddlLeader, ddlMemberStatus };
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:46,代码来源:MemberCountFilter.cs

示例3: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            _rblTagType = new RockRadioButtonList();
            _rblTagType.ID = filterControl.ID + "_tagType";
            _rblTagType.RepeatDirection = RepeatDirection.Horizontal;
            _rblTagType.Items.Add( new ListItem( "Personal Tags", "1" ) );
            _rblTagType.Items.Add( new ListItem( "Organizational Tags", "2" ) );
            _rblTagType.SelectedValue = "1";
            _rblTagType.AutoPostBack = true;
            _rblTagType.SelectedIndexChanged += rblTagType_SelectedIndexChanged;
            filterControl.Controls.Add( _rblTagType );

            _ddlTagList = new RockDropDownList();
            _ddlTagList.ID = filterControl.ID + "_ddlTagList";
            _ddlTagList.AddCssClass( "js-tag-filter-list" );
            filterControl.Controls.Add( _ddlTagList );

            PopulateTagList();

            return new Control[2] { _rblTagType, _ddlTagList };
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:25,代码来源:TagFilter.cs

示例4: FilterValueControl

        /// <summary>
        /// Gets the filter value control.
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="required">if set to <c>true</c> [required].</param>
        /// <returns></returns>
        public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required )
        {
            var ddlList = new RockDropDownList();
            ddlList.ID = string.Format( "{0}_ddlList", id );
            ddlList.AddCssClass( "js-filter-control" );

            if ( !required )
            {
                ddlList.Items.Add( new ListItem() );
            }

            var control = EditControl( configurationValues, id );
            if ( control is RockCheckBoxList )
            {
                foreach( ListItem li in ((RockCheckBoxList)control).Items)
                {
                    ddlList.Items.Add( new ListItem( li.Text, li.Value ) );
                }
            }

            return ddlList;
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:29,代码来源:SelectMultiFieldType.cs

示例5: CreateChildControls

        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hfValue.ID = this.ID + "_hfValue";
            Controls.Add( _hfValue );

            _actionControls = new List<RockTextBox>();
            _buttonHtmlControls = new List<RockDropDownList>();
            _activityControls = new List<RockDropDownList>();
            _responseControls = new List<RockTextBox>();

            string[] nameValues = this.Value.Split( new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries );
            for ( int i = 0; i < nameValues.Length; i++ )
            {
                string[] nameValueResponse = nameValues[i].Split( new char[] { '^' } );

                var tbAction = new RockTextBox();
                tbAction.ID = this.ID + "_tbAction" + i.ToString();
                Controls.Add( tbAction );
                tbAction.Placeholder = "Action";
                tbAction.AddCssClass( "form-action-key" );
                tbAction.AddCssClass( "form-control" );
                tbAction.AddCssClass( "js-form-action-input" );
                tbAction.Text = nameValueResponse.Length > 0 ? nameValueResponse[0] : string.Empty;
                _actionControls.Add( tbAction );

                var ddlButtonHtml = new RockDropDownList();
                ddlButtonHtml.ID = this.ID + "_ddlButtonHtml" + i.ToString();
                Controls.Add( ddlButtonHtml );
                ddlButtonHtml.AddCssClass( "form-action-button" );
                ddlButtonHtml.AddCssClass( "form-control" );
                ddlButtonHtml.AddCssClass( "js-form-action-input" );
                var definedType = Rock.Web.Cache.DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.BUTTON_HTML.AsGuid() );
                foreach( var definedValue in definedType.DefinedValues )
                {
                    var li = new ListItem( definedValue.Value, definedValue.Guid.ToString() );
                    li.Selected = nameValueResponse.Length > 1 && li.Value.Equals( nameValueResponse[1], StringComparison.OrdinalIgnoreCase );
                    ddlButtonHtml.Items.Add( li );
                }
                _buttonHtmlControls.Add( ddlButtonHtml );

                var ddlActivity = new RockDropDownList();
                ddlActivity.ID = this.ID + "_ddlActivity" + i.ToString();
                Controls.Add( ddlActivity );
                ddlActivity.AddCssClass( "form-action-value" );
                ddlActivity.AddCssClass( "form-control" );
                ddlActivity.AddCssClass( "js-form-action-input" );
                ddlActivity.DataTextField = "Value";
                ddlActivity.DataValueField = "Key";
                ddlActivity.DataSource = Activities;
                ddlActivity.DataBind();
                ddlActivity.Items.Insert( 0, new ListItem( string.Empty, string.Empty ) );
                foreach(ListItem li in ddlActivity.Items)
                {
                    li.Selected = nameValueResponse.Length > 2 && li.Value.Equals( nameValueResponse[2], StringComparison.OrdinalIgnoreCase );
                }
                _activityControls.Add( ddlActivity );

                var tbResponse = new RockTextBox();
                tbResponse.ID = this.ID + "_tbResponse" + i.ToString();
                Controls.Add( tbResponse );
                tbResponse.Placeholder = "Response Text";
                tbResponse.AddCssClass( "form-action-response" );
                tbResponse.AddCssClass( "form-control" );
                tbResponse.AddCssClass( "js-form-action-input" );
                tbResponse.Text = nameValueResponse.Length > 3 ? nameValueResponse[3] : string.Empty;
                _responseControls.Add( tbResponse );
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:73,代码来源:WorkflowFormActionList.cs

示例6: FilterValueControl

        /// <summary>
        /// Gets the filter value control.
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="required">if set to <c>true</c> [required].</param>
        /// <param name="filterMode">The filter mode.</param>
        /// <returns></returns>
        public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required, FilterMode filterMode )
        {
            string yesText = "Yes";
            string noText = "No";

            if ( configurationValues != null )
            {
                if ( configurationValues.ContainsKey( "truetext" ) )
                {
                    yesText = configurationValues["truetext"].Value;
                }
                if ( configurationValues.ContainsKey( "falsetext" ) )
                {
                    noText = configurationValues["falsetext"].Value;
                }
            }

            ListControl filterValueControl = new RockDropDownList();

            filterValueControl.ID = string.Format( "{0}_ctlCompareValue", id );
            filterValueControl.AddCssClass( "js-filter-control" );

            if ( !required )
            {
                filterValueControl.Items.Add( new ListItem() );
            }
            filterValueControl.Items.Add( new ListItem( yesText, "True" ) );
            filterValueControl.Items.Add( new ListItem( noText, "False" ) );
            return filterValueControl;
        }
开发者ID:azturner,项目名称:Rock,代码行数:38,代码来源:BooleanFieldType.cs

示例7: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var controls = new List<Control>();

            var ddlIntegerCompare = ComparisonHelper.ComparisonControl( ComparisonHelper.NumericFilterComparisonTypes );
            ddlIntegerCompare.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
            ddlIntegerCompare.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlIntegerCompare );
            controls.Add( ddlIntegerCompare );

            var ddlGradeDefinedValue = new RockDropDownList();
            ddlGradeDefinedValue.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
            ddlGradeDefinedValue.AddCssClass( "js-filter-control" );

            ddlGradeDefinedValue.Items.Clear();

            // add blank item as first item
            ddlGradeDefinedValue.Items.Add( new ListItem() );

            var schoolGrades = DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.SCHOOL_GRADES.AsGuid() );
            if ( schoolGrades != null )
            {
                foreach ( var schoolGrade in schoolGrades.DefinedValues.OrderByDescending( a => a.Value.AsInteger() ) )
                {
                    ddlGradeDefinedValue.Items.Add( new ListItem( schoolGrade.Description, schoolGrade.Guid.ToString() ) );
                }
            }

            filterControl.Controls.Add( ddlGradeDefinedValue );
            controls.Add( ddlGradeDefinedValue );

            return controls.ToArray();
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:37,代码来源:GradeFilter.cs

示例8: FilterValueControl

        /// <summary>
        /// Gets the filter value control.
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="required">if set to <c>true</c> [required].</param>
        /// <returns></returns>
        public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required )
        {
            var ddl = new RockDropDownList();
            ddl.ID = string.Format( "{0}_ctlCompareValue", id );
            ddl.AddCssClass( "js-filter-control" );

            if ( !required )
            {
                ddl.Items.Add( new ListItem() );
            }
            ddl.Items.Add( new ListItem( "True", "True" ) );
            ddl.Items.Add( new ListItem( "False", "False" ) );
            return ddl;
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:21,代码来源:BooleanFieldType.cs

示例9: CreateChildControls

        /// <summary>
        /// Creates the child controls.
        /// </summary>
        /// <returns></returns>
        public override Control[] CreateChildControls( Type entityType, FilterField filterControl )
        {
            var controls = new List<Control>();

            ddlStringFilterComparison = ComparisonHelper.ComparisonControl( ComparisonHelper.StringFilterComparisonTypes );
            ddlStringFilterComparison.ID = string.Format( "{0}_{1}", filterControl.ID, controls.Count() );
            ddlStringFilterComparison.AddCssClass( "js-filter-compare" );
            filterControl.Controls.Add( ddlStringFilterComparison );
            controls.Add( ddlStringFilterComparison );

            tbPostalCode = new RockTextBox();
            tbPostalCode.ID = filterControl.ID + "_tbPostalCode";
            tbPostalCode.AddCssClass( "js-filter-control" );
            filterControl.Controls.Add( tbPostalCode );
            controls.Add( tbPostalCode );

            return controls.ToArray();
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:22,代码来源:PostalCodeFilter.cs


注:本文中的Rock.Web.UI.Controls.RockDropDownList.AddCssClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。