本文整理汇总了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;
}
示例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 = " ";
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 };
}
示例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 };
}
示例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;
}
示例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 );
}
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}