Hello!
I've seen couple of examples on how to validate RadComboBox with RequiredFieldValidator, but I can't get it working. In my scenario I have RadGrid with EditUserControl which has couple of RadComboBoxes I tried to validate, but without any success. What happens is that on a button click code is executed, but without any validation.
This is the code example of a UserControl:
Any help would be appreciated.
Thank you,
Hrvoje
I've seen couple of examples on how to validate RadComboBox with RequiredFieldValidator, but I can't get it working. In my scenario I have RadGrid with EditUserControl which has couple of RadComboBoxes I tried to validate, but without any success. What happens is that on a button click code is executed, but without any validation.
This is the code example of a UserControl:
<
div
class
=
"ucWrapper"
>
<
div
class
=
"ucLeft"
>
<
table
>
<
tr
>
<
td
>
Vrsta prijave:
</
td
>
<
td
>
<
telerik:RadComboBox
ID
=
"rcbVrstaPrijave"
Text='<%# DataBinder.Eval(Container, "DataItem.VrstaPrijave") %>'
runat="server" Skin="Hay">
</
telerik:RadComboBox
>
<
asp:RequiredFieldValidator
ID
=
"rfv1"
ControlToValidate
=
"rcbVrstaPrijave"
runat
=
"server"
ErrorMessage
=
"*"
InitialValue
=
"0"
></
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Tip:
</
td
>
<
td
>
<
telerik:RadComboBox
ID
=
"rcbTip"
runat
=
"server"
Text='<%# DataBinder.Eval(Container, "DataItem.Tip") %>'
Skin="Hay">
</
telerik:RadComboBox
>
Status:
<
telerik:RadComboBox
ID
=
"rcbStatus"
runat
=
"server"
Text='<%# DataBinder.Eval(Container, "DataItem.Status") %>'
Skin="Hay">
</
telerik:RadComboBox
>
<
asp:RequiredFieldValidator
runat
=
"server"
ID
=
"rfv2"
ValidationGroup
=
"Group1"
ControlToValidate
=
"rcbTip"
Display
=
"dynamic"
ErrorMessage
=
"*"
/>
</
td
>
</
tr
>
<
tr
>
<
td
>
Opis:
</
td
>
<
td
>
<
asp:TextBox
ID
=
"txtOpis"
runat
=
"server"
TextMode
=
"MultiLine"
Width
=
"455px"
Height
=
"200px"
Text='<%# DataBinder.Eval(Container, "DataItem.Opis") %>' Font-Names="Calibri"
Font-Size="10pt"></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:Button
ID
=
"btnUpdate"
Text
=
"Spremi"
runat
=
"server"
CommandName
=
"Update"
ValidationGroup
=
"Group1"
Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>'>
</
asp:Button
>
<
asp:Button
ID
=
"btnInsert"
Text
=
"Spremi"
runat
=
"server"
ValidationGroup
=
"Group1"
CommandName
=
"PerformInsert"
Visible='<%# DataItem is Telerik.Web.UI.GridInsertionObject %>'></
asp:Button
>
</
td
>
Any help would be appreciated.
Thank you,
Hrvoje