This is a migrated thread and some comments may be shown as answers.

Custom Validator not invoked in RadGrid

1 Answer 222 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 06 Jul 2011, 07:16 AM
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
<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>

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 11 Jul 2011, 08:37 AM
Hello Marco,

I tried to replicate the issue you described in the Flexible Server-side Validation demo but to no avail.
You can read more about custom validators here.
If the problem persists, please send us the validation function you use.

I hope this helps.

Kind regards,
Mira
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Marco
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or