I have a dropdownlist I want to set the requiredfieldvalidator for the dropdownlist (stateComboBox) Now my question is how can i set initial value for stateComboBox in my RequiredFieldValidator. Thanks in advance
<td>
<telerik:RadDropDownList ID="stateComboBox" runat="server" DataTextField="SateCode"
DataValueField="SateCode" Width="173px">
</telerik:RadDropDownList>
</td>
<td>
<asp:RequiredFieldValidator ID="rvfState" runat="server" ControlToValidate="stateComboBox"
ErrorMessage="State is Required" ForeColor="#CC0000">*</asp:RequiredFieldValidator>
</td>
On the code behind you can use
rvfState.InitialValue =
I guess you will need to grab the first object from your data object. so if it is a DataTable you could say rvfState.InitialValue = dt.rows[0]["SateCode"]