0

The Obout ComboBox, was used like bellow:

<asp:RequiredFieldValidator ID="rfvEndTipoEndereco" runat="server" ControlToValidate="ddlTipoEndereco"
    ValidationGroup="vagIndCad" ErrorMessage="Informe o tipo de endereço" ToolTip="Campo obrigatório">*</asp:RequiredFieldValidator>
    <obout:ComboBox  ID="ddlTipoEndereco" runat="server"    EnableLoadOnDemand="True" 
        MenuWidth="150px" oninit="Init_ComboBox" Width="150px" ></obout:ComboBox>

But it is not working properly, is not validating when the selected value is "".

Which is equal to: https://www.obout.com/interface/aspnet_integration_validators.aspx

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Tito
  • 722
  • 4
  • 26
  • 55

1 Answers1

0

I'm not sure about this Obout controls, but when using validators with DropDownLists you should set the InitialValue on the validator to the value you'd like to check against. For instance:

<asp:RequiredFieldValidator ID="rfvEndTipoEndereco" runat="server" 
ControlToValidate="ddlTipoEndereco"  
ValidationGroup="vagIndCad" 
ErrorMessage="Informe o tipo de endereço" ToolTip="Campo obrigatório"
InitialValue="Select an item">*</asp:RequiredFieldValidator>
rla4
  • 1,228
  • 13
  • 25
  • I believe the problem is because the initialValue of the obout ComboBox is -1, instead of 0 – Tito Oct 21 '13 at 11:15