I have a project that previously used asp dropdown lists. I am switching these over to telerik controls for increased functionality. However, I need to be able to dynamically reference and populate the controls in the page load event. Here is how I used to accomplish this:
How do I replicate this behavior with a telerik control? I've tried something like this:
But the properties I'm trying to set are invalid and do not exist. Suggestions or help appreciated.
Dim
dropDown
As
New
DropDownList
dropDown =
CType
(
Me
.Master.FindControl(
"id_"
& dynamic_code), DropDownList)
With
dropDown
.Enabled =
True
.DataSource = SqlDataReader
.DataValueField =
"code"
.DataTextField =
"desc"
.DataBind()
End
With
How do I replicate this behavior with a telerik control? I've tried something like this:
Dim
dropDown
As
RadComboBoxItem
Dim
instance
As
RadComboBoxItem
dropDown = instance.FindControl(
"id_"
& dynamic_code)
With
dropDown
.Enabled =
True
.DataSource = SqlDataReader
.DataValueField =
"code"
.DataTextField =
"desc"
.DataBind()
End
With
But the properties I'm trying to set are invalid and do not exist. Suggestions or help appreciated.