本文整理汇总了C#中Rock.Web.UI.Controls.RockDropDownList.BindToDefinedType方法的典型用法代码示例。如果您正苦于以下问题:C# RockDropDownList.BindToDefinedType方法的具体用法?C# RockDropDownList.BindToDefinedType怎么用?C# RockDropDownList.BindToDefinedType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Web.UI.Controls.RockDropDownList
的用法示例。
在下文中一共展示了RockDropDownList.BindToDefinedType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfigurationControls
/// <summary>
/// Creates the HTML controls required to configure this type of field
/// </summary>
/// <returns></returns>
public override List<Control> ConfigurationControls()
{
var controls = base.ConfigurationControls();
var ddl = new RockDropDownList();
controls.Add( ddl );
ddl.AutoPostBack = true;
ddl.SelectedIndexChanged += OnQualifierUpdated;
var definedType = DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.GROUPTYPE_PURPOSE.AsGuid() );
ddl.BindToDefinedType( definedType, true );
ddl.Label = "Purpose";
ddl.Help = "An optional setting to limit the selection of group types to those that have the selected purpose.";
return controls;
}
示例2: AddDynamicControls
//.........这里部分代码省略.........
phRegistrantFormFieldFilters.Controls.Add( ddlGenderFilter );
var ddlGenderFilter2 = new RockDropDownList();
ddlGenderFilter2.BindToEnum<Gender>( true );
ddlGenderFilter2.ID = "ddlGenderFilter";
ddlGenderFilter2.Label = "Gender";
ddlGenderFilter2.SetValue( fRegistrants.GetUserPreference( "WL-Gender" ) );
phWaitListFormFieldFilters.Controls.Add( ddlGenderFilter2 );
string dataFieldExpression = "PersonAlias.Person.Gender";
var genderField = new EnumField();
genderField.DataField = dataFieldExpression;
genderField.HeaderText = "Gender";
genderField.SortExpression = dataFieldExpression;
gRegistrants.Columns.Add( genderField );
var genderField2 = new EnumField();
genderField2.DataField = dataFieldExpression;
genderField2.HeaderText = "Gender";
genderField2.SortExpression = dataFieldExpression;
gGroupPlacements.Columns.Add( genderField2 );
var genderField3 = new EnumField();
genderField3.DataField = dataFieldExpression;
genderField3.HeaderText = "Gender";
genderField3.SortExpression = dataFieldExpression;
gWaitList.Columns.Add( genderField3 );
break;
}
case RegistrationPersonFieldType.MaritalStatus:
{
var ddlMaritalStatusFilter = new RockDropDownList();
ddlMaritalStatusFilter.BindToDefinedType( DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.PERSON_MARITAL_STATUS.AsGuid() ), true );
ddlMaritalStatusFilter.ID = "ddlMaritalStatusFilter";
ddlMaritalStatusFilter.Label = "Marital Status";
ddlMaritalStatusFilter.SetValue( fRegistrants.GetUserPreference( "Marital Status" ) );
phRegistrantFormFieldFilters.Controls.Add( ddlMaritalStatusFilter );
var ddlMaritalStatusFilter2 = new RockDropDownList();
ddlMaritalStatusFilter2.BindToDefinedType( DefinedTypeCache.Read( Rock.SystemGuid.DefinedType.PERSON_MARITAL_STATUS.AsGuid() ), true );
ddlMaritalStatusFilter2.ID = "ddlMaritalStatusFilter";
ddlMaritalStatusFilter2.Label = "Marital Status";
ddlMaritalStatusFilter2.SetValue( fRegistrants.GetUserPreference( "WL-Marital Status" ) );
phWaitListFormFieldFilters.Controls.Add( ddlMaritalStatusFilter2 );
string dataFieldExpression = "PersonAlias.Person.MaritalStatusValue.Value";
var maritalStatusField = new RockBoundField();
maritalStatusField.DataField = dataFieldExpression;
maritalStatusField.HeaderText = "MaritalStatus";
maritalStatusField.SortExpression = dataFieldExpression;
gRegistrants.Columns.Add( maritalStatusField );
var maritalStatusField2 = new RockBoundField();
maritalStatusField2.DataField = dataFieldExpression;
maritalStatusField2.HeaderText = "MaritalStatus";
maritalStatusField2.SortExpression = dataFieldExpression;
gGroupPlacements.Columns.Add( maritalStatusField2 );
var maritalStatusField3 = new RockBoundField();
maritalStatusField3.DataField = dataFieldExpression;
maritalStatusField3.HeaderText = "MaritalStatus";
maritalStatusField3.SortExpression = dataFieldExpression;
gWaitList.Columns.Add( maritalStatusField3 );
break;