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

problem with ValidationSettings.ValidationGroup

3 Answers 203 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 26 Nov 2008, 07:30 PM
Hi
It seems like ValidationSettings.ValidationGroup does not take affect at client side.
To reproduce error please add the following lines in demo Examples\DataEditing\Validation\DefaultCS.aspx just after RadGrid:

        <asp:TextBox ID="tbValidation" runat="server"/>
        <asp:RequiredFieldValidator runat="server" ID="rfvValidation"
           ControlToValidate="tbValidation" ErrorMessage="Field is required!">
        </asp:RequiredFieldValidator>

then run example, set validation drop down to "FormValidationGroup" ant try to add new record (rfvValidation will not allow).
Looks like RadGrid performs validation only at server side.

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 01 Dec 2008, 07:32 AM
Hello Dmitry,

Attached to this message is the modification in question. Please note, it will disallow edit (as set in the Validation settings), but allow the "AddNewRow" command to proceed.
Let me know if I am leaving something out.

Regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dmitry
Top achievements
Rank 1
answered on 03 Dec 2008, 01:08 AM
Hello,

Thank you for answer.
When I wrote that validator "rfvValidation" does not allow to insert new record I didn't mean button "Add new record". You can click "Add new record" and you will see edit form, but you can't save this record (grin tick button).
Try the following:
1. Add to your example into Validation settings ValidationGroup="grid"
2. Run and click "Edit row" button.
3. Try to save record
at this moment the validator "rfvValidation" fires.
but validator "rfvValidation" does not have ValidationGroup="grid"
0
Yavor
Telerik team
answered on 03 Dec 2008, 09:25 AM
Hi Dmitry,

In this case, based on the sample sent earlier, and the additional suggestions which you included, you can set a validation group for the textbox as well. This will look like:

.aspx
 <asp:Button runat="server" ID="Button1" Text="Export" OnClick="Button1_Click" /> 
            <asp:TextBox ID="tbValidation" runat="server" ValidationGroup="grid2"/>  
            <asp:RequiredFieldValidator runat="server" ID="rfvValidation" ValidationGroup="grid2" 
            ControlToValidate="tbValidation" ErrorMessage="Field is required!">  
            </asp:RequiredFieldValidator> 

This will eliminate the issue.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Dmitry
Top achievements
Rank 1
Share this question
or