Hi
I want to add validation for Radcombobox which contains checkboxes for multiple selection. The issue is the custom validation handler is getting fired on page load. I want to get if fired every time when the user clicks on submit.
Please find the code below ;
In the code behind :
Please help . This is urgent
I want to add validation for Radcombobox which contains checkboxes for multiple selection. The issue is the custom validation handler is getting fired on page load. I want to get if fired every time when the user clicks on submit.
Please find the code below ;
<telerik:RadComboBox ID=
"ddlAcc"
runat=
"server"
DataValueField=
"Value"
DataTextField=
"Text"
Width=
"270"
AllowCustomText=
"true"
ExpandDirection=
"Up"
AutoPostBack=
"true"
Height=
"150"
CausesValidation=
"true"
HighlightTemplatedItems=
"true"
OnItemDataBound=
"ddlAcc_ItemDataBound"
OnSelectedIndexChanged=
"ddlAcc_SelectedIndexChanged"
>
<HeaderTemplate>
<asp:CheckBox runat=
"server"
ID=
"SelectAll"
/>
<asp:Label runat=
"server"
ID=
"hdrLabel"
Font-Bold=
"false"
AssociatedControlID=
"SelectAll"
>Select All</asp:Label>
</HeaderTemplate>
<ItemTemplate>
<div onclick=
"StopPropagation(event)"
>
<asp:CheckBox runat=
"server"
ID=
"chk1"
/>
<asp:Label runat=
"server"
ID=
"label1"
Font-Bold=
"false"
Font-Size=
"Smaller"
AssociatedControlID=
"chk1"
><%# DataBinder.Eval(Container,
"Text"
) %></asp:Label>
</div>
</ItemTemplate>
</telerik:RadComboBox>
<asp:CustomValidator ID=
"cvAccNos"
runat=
"server"
ErrorMessage=
"<%$ Resources: ErrorMessages, error.missing.accountnumber %>"
OnServerValidate=
"cvAccNos_ServerValidate"
ControlToValidate=
"ddlAcc"
Text=
"<%$ Resources: ErrorMessages, error.validatoricon %>"
EnableClientScript=
"False"
/>
In the code behind :
protected
void
cvAccNos_ServerValidate(
object
sender, ServerValidateEventArgs args)
{
args.IsValid = !
string
.IsNullOrEmpty(GetCheckBoxValues());
}
Please help . This is urgent