I hope that this will be an easy problem to solve! I have the following ComboBox in my page:
And in Page_Load() I attempt to set the value as follows (the DataBind is just there to make sure!):
However, even though the SelectedValue on the ComboBox is set, the Text is blank and the SelectedIndex appears to have a value of "-1".
Am I doing something incredibly stupid here, or am I required to perform some kind of work-around (as opposed to how I may handle a DropDownList, for example)? Having read other threads, I have also tried setting the SelectedIndex using the FindItemIndexByValue functionality, but this doesn't seem to work either.
Any help would be appreciated. Thanks,
<
telerik:RadComboBox
ID
=
"rcbLocation"
runat
=
"server"
AllowCustomText
=
"True"
DataSourceID
=
"sdsLocation"
DataTextField
=
"Location_Name"
DataValueField
=
"Location_ID"
MarkFirstMatch
=
"True"
>
</
telerik:RadComboBox
>
And in Page_Load() I attempt to set the value as follows (the DataBind is just there to make sure!):
rcbLocation.DataBind();
rcbLocation.SelectedValue = ReturnedData[
"Master_Location"
].ToString();
However, even though the SelectedValue on the ComboBox is set, the Text is blank and the SelectedIndex appears to have a value of "-1".
Am I doing something incredibly stupid here, or am I required to perform some kind of work-around (as opposed to how I may handle a DropDownList, for example)? Having read other threads, I have also tried setting the SelectedIndex using the FindItemIndexByValue functionality, but this doesn't seem to work either.
Any help would be appreciated. Thanks,