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

Validation inside grid on Templatefield

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Santosh
Top achievements
Rank 1
Santosh asked on 11 Jan 2012, 06:58 AM
Hello Team,

Here is one scenario


I have used a grid for above scenario. Records in grid are dynamically changes on drop down selection.
In above if I select Date and focus lost of Date, Requirefieldvalidator should display the message that start time and end time should be entered for selected date.
At the same time I want add one another validator that checks the End time should be greater than start time.

Please help me to do this.

Thanks,
Santosh

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Jan 2012, 07:30 AM
Hello Santhosh,

Try the following.
aspx:
<telerik:GridTemplateColumn >
   <ItemTemplate>
      <telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server"></telerik:RadDateTimePicker>
       <asp:RequiredFieldValidator ID="req" runat="server" ControlToValidate="RadDateTimePicker1" ErrorMessage="Please fill date" ></asp:RequiredFieldValidator>
       <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="RadDateTimePicker1" ControlToValidate="RadDateTimePicker2" ErrorMessage="End time should be greater"></asp:CompareValidator>
   </ItemTemplate>
</telerik:GridTemplateColumn>

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