I have Telerik RadComboBox
,
<telerik:RadComboBox runat="server" ID="comboTown" Width="150px">
</telerik:RadComboBox>
And I bind this table
Town
-----
TownOne
TownTwo
TownThree
TownFour
to comboTown
show as below
comboTown.DataSource = DB.Towns.ToList();
comboTown.DataTextField = "Town";
comboTown.DataValueField = "Town";
But , when I set selectedValue
for comboTown
likes comboTown.SelectedValue= "TownTwo";
I get this error message
Selection out of range
Parameter name: value
I want to know why , what am i doing wrong?