The content you're reading is getting on in years This post is on the older side and its content may be out of date. Be sure to visit our blogs homepage for our latest news, updates and information.
<
telerik:RadComboBox
ID
=
"State"
CssClass
"sfTxt"
runat
"server"
>
</
hr
/>
"DependantState"
protected virtual RadComboBox ddl
{
get
return this.Container.GetControl<
RadComboBox
>("State", true);
}
protected virtual RadComboBox ddlDependant
>("DependantState", true);
protected
override
void
InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
this
.ddl.DataSource = statesList();
.ddl.DataTextField =
"Value"
;
.ddl.DataValueField =
"Key"
.ddl.DataBind();
public
IEnumerable<ScriptDescriptor> GetScriptDescriptors()
var descriptor =
new
ScriptControlDescriptor(
typeof
(States).FullName,
.ClientID);
descriptor.AddComponentProperty(
"dropdown"
,
.ddl.ClientID);
"dropdownDependant"
.ddlDependant.ClientID);
descriptor.AddProperty(
"dataFieldName"
.MetaField.FieldName);
return
[] { descriptor };
get_value:
function
() {
var
arrayOfValues = [];
arrayOfValues.push(
._dropdown._highlightedItem._text);
._dropdownDependant._highlightedItem._text);
arrayOfValues.toString();
},
// Sets the value of the dropdown control depending on DisplayMode.
set_value:
(values) {
if
arrayOfValues = values.split(
','
)
._dropdown.set_text(arrayOfValues[0]);
._dropdownDependant.set_text(arrayOfValues[1]);
Stanislav Velikov is a Tech Support Engineer at Telerik. He joined the Sitefinity Support team in April 2011.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.