Bind RadControl ComboBox to Module.
This should be pretty straight forward but for what ever reason, I can't get it to work.
This is my code:
protected
void
Page_Load(
object
sender, EventArgs e)
var dynamicModuleManagerDropdown = DynamicModuleManager.GetManager();
Type myLocationType = TypeResolutionService.ResolveType(
"Telerik.Sitefinity.DynamicTypes.Model.myLocations.myLocation"
);
// This is how we get the collection of ContentPage items
var mylocations = dynamicModuleManagerDropdown.GetDataItems(myLocationType).Where(i => i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && i.Visible ==
true
);
RadComboBoxLocation.DataSource = mylocations;
RadComboBoxLocation.DataBind();
Telerik.Sitefinity.DynamicTypes.Model.myLocations.myLocation
<
telerik:RadComboBox
ID
=
"RadComboBoxLocation"
runat
=
"server"
Height
=
"200px"
Width
=
"200px"
DropDownWidth
=
"298px"
EmptyMessage
=
"Select a location"
HighlightTemplatedItems
=
"true"
EnableLoadOnDemand
=
"true"
DataValueField
=
"nameOfCourt"
>
<
HeaderTemplate
>
<
table
style
=
"width: 275px"
cellspacing
=
"0"
cellpadding
=
"0"
>
<
tr
>
<
td
style
=
"width: 177px;"
>
Location name</
td
>
</
tr
>
</
table
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
div
class
=
"ddlocations"
>
<%# DataBinder.Eval(Container.DataItem, "nameOfLocation")%>
</
div
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
Cancel that, it really was a simple solution. Forgot to give DataValueField and DataTextField a value!