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

Allow radgrid to update, with validation controls on the page.

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aash
Top achievements
Rank 1
Aash asked on 06 Dec 2010, 10:57 AM
Hi,

 I have a page with several validation controls. However when i attempt to add a row to my grid, the validation control prevents the postback from happening. Is there a way to set the grids update/insert button to causevalidation = false.

Thanks,
Aash.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Dec 2010, 12:04 PM
Hello Aash

In order to avoid this, you can set ValidationGroup to the validator, control to validate and to the button. Submission of a particular group of controls will not execute the validation controls of another group(Here it will not validate the RadGrid). This helps you to group your controls and have separate validation controls for each group.

ASPX:
<telerik:RadGrid ID="RadGrid1">
. . . .
</telerik:RadGrid>
<br />
<asp:TextBox ID="TextBox1" runat="server" ValidationGroup="validationgroup1"></asp:TextBox>
<asp:RequiredFieldValidator ValidationGroup="validationgroup1" runat="server" ID="RequiredFieldValidator1"
    ErrorMessage="This field is required" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
<asp:Button ValidationGroup="validationgroup1" ID="Button1" runat="server" Text="Button"
    ></asp:Button>

-Shinu.
Tags
Grid
Asked by
Aash
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or