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

Radgrid postback issue before validating controls under edit template

1 Answer 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mahendra
Top achievements
Rank 1
Mahendra asked on 30 Oct 2012, 11:35 AM
my grid

 <EditItemTemplate>
                                        <telerik:RadDatePicker  ID="dtTravelDate" DateInput-DateFormat="MM/dd/yyyy" DateInput-DisplayDateFormat="MM/dd/yyyy"
                                            DbSelectedDate='<%# Eval("Travel_Date") %>' runat="server" CssClass="ClaimDateControl"
                                            Width="100px">
                                        </telerik:RadDatePicker>
                                      <asp:RequiredFieldValidator ID="reqTravelDate" runat="server" ControlToValidate="dtTravelDate" EnableClientScript="true"
                                            ErrorMessage="*" ValidationGroup="Test"> </asp:RequiredFieldValidator>
                                    </EditItemTemplate>

and my itembound event code as follows

 

 if (e.Item is GridEditableItem && e.Item.IsInEditMode)
                    {

                        if (e.Item is GridEditFormInsertItem)
                        {
                            ((e.Item as GridEditFormItem).FindControl("PerformInsertButton") as LinkButton).ValidationGroup = "Test";
                        }
                        else
                        {
                            ((e.Item as GridEditFormItem).FindControl("UpdateButton") as LinkButton).ValidationGroup = "Test";
                        }
                    }

my issues is every time before validate control fired griditemcommand event ...



please please hepl me

thanks in advance

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 01 Nov 2012, 12:23 PM
Hello Mahendra,

Please try to use ItemCreated instead of the ItemDataBound server event as demonstrated in the following article:
http://www.telerik.com/help/aspnet-ajax/grid-validation.html

I hope this will prove helpful. Please give it a try and let me know about the result.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Mahendra
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or