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

[Solved] Rad Grid TemplateColums Validate

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
waruni
Top achievements
Rank 1
waruni asked on 23 Feb 2010, 05:32 AM
Hi,

In Rad grid Control, there are 2 TemplateColums (Start time and end time) and it has two RadTimePicker control for      EditItemTemplate .im using the master page as well.
I want to validate that end time value is greater than the start time .
 How to use Compare Validator?

Can you plz tell me the way of doing this.because this is ugent.
 
 <telerik:GridTemplateColumn HeaderText="Starttime" UniqueName="Starttime" > 
            <EditItemTemplate> 
                <telerik:RadTimePicker ID="rtpStartTime" runat="server">  
                </telerik:RadTimePicker> 
             </EditItemTemplate> 
            <ItemTemplate> 
                <asp:Label ID="lblStarttime" runat="server" Text='<%# Eval("StartTime","{0:t}") %>'></asp:Label> 
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 
          
         <telerik:GridTemplateColumn HeaderText="End time" UniqueName="EndTime">  
            <EditItemTemplate> 
                <telerik:RadTimePicker ID="rtpEndTime" runat="server"    
                </telerik:RadTimePicker>                  
            </EditItemTemplate> 
            <ItemTemplate> 
                <asp:Label ID="lblEndTime" runat="server" Text='<%# Eval("EndTime", "{0:t}") %>'></asp:Label> 
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 

Thanks
Waruni

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 25 Feb 2010, 07:34 AM
Hi Waruni,

Please take a look at the Flexible Server-side Validation help topic and demo to see how to add validator to the EditItemTemplate of a GridTemplateColumn
You can find a sample of CompareValidator validating the dates picked by the user ensuring that end time value is greater than the start time here.

I hope you find this useful.

Regards,
Mira
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
waruni
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or