I'm using : ASPxComboBox
The problem is how to set selectedValue from code behind? If my html is like this:
<dxe:ASPxComboBox ID="cbxJobType" runat="server" width="200px" MaxLength="50">
<Items>
<dxe:ListEditItem Text="Contract" Value="0" />
<dxe:ListEditItem Text="Full Time" Value="1" />
<dxe:ListEditItem Text="Part Time" Value="2" />
</Items>
<ValidationSettings ErrorDisplayMode="ImageWithTooltip">
<RequiredField ErrorText="Required Value" IsRequired="True" />
</ValidationSettings>
</dxe:ASPxComboBox>
You can either:
Set the ASPxComboBox.SelectedIndex property;
Select the required Item by its Value via the ASPxComboBox.Value property:
Code Behind:
On the client side, I found there is the equivalent of Ruchi's suggestion:
Which is:
Go here to learn more about the ASPxComboBox on the client side (ASPxClientComboBox).
Go here to learn more about the ASPxComboBox on the server side.
There you can browse through all their members, constructors, events and methods.
You can also look at the following
Hope though this is posted late, it may help someone else
Client-Side Script
Give ClientInstanceName property to comboBoxto access it client side and ID property as cbxJobType to access control server side.
Server-Side Code
This code works fine too: