Hi everybody,
Since RadNumericTextBoxes do not provide a build-in feature to have it as required field, we implemented a custom validator that checks for a missing value. This validator works well, if the NumericTextBox is not within a RadGrid. If we use the custom validator within a EditTemplate, it is not invoked. When we use a asp:RequiredFieldValidor instead, the validation is processed. Why is a custom validor not invoked when we click "Insert" or "Update" while a RequiredFieldValidator works correctly?
Thanks in advance
Marco
Since RadNumericTextBoxes do not provide a build-in feature to have it as required field, we implemented a custom validator that checks for a missing value. This validator works well, if the NumericTextBox is not within a RadGrid. If we use the custom validator within a EditTemplate, it is not invoked. When we use a asp:RequiredFieldValidor instead, the validation is processed. Why is a custom validor not invoked when we click "Insert" or "Update" while a RequiredFieldValidator works correctly?
Thanks in advance
Marco
<
EditFormSettings
EditFormType
=
"Template"
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
/>
<
FormTemplate
>
<
table
cellspacing
=
"2"
cellpadding
=
"1"
border
=
"0"
>
<
tr
>
<
td
>
<
telerik:RadNumericTextBox
ID
=
"Amount"
runat
=
"server"
DbValue='<%# Bind("Amount") %>' Width="80px" />
<!-- This one is invoked -->
<
asp:RequiredFieldValidator
ControlToValidate
=
"Amount"
ErrorMessage
=
"*"
runat
=
"server"
Text
=
"*"
/>
<!-- This one is NOT invoked but works well when not embedded in RadGrid-->
<
asp:CustomValidator
ID
=
"Amount_Required"
ClientValidationFunction
=
"CheckNumberRequired"
ControlToValidate
=
"Amount"
runat
=
"server"
ValidateEmptyText
=
"true"
/>
</
td
>
</
tr
>