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> |
Thanks
Waruni
| <telerik:GridDateTimeColumn HeaderText="Start Date" SortExpression="startDate" UniqueName="startDate" AutoPostBackOnFilter="true" DataField="startDate" |
| FilterControlWidth="110px" PickerType="DatePicker" DataFormatString="{0:d/M/yyyy}" DataType="System.DateTime"> |
| </telerik:GridDateTimeColumn> |
| Private Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated |
| If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then |
| Dim item As GridEditableItem = CType(e.Item, GridEditableItem) |
| Dim startColumnEditor As GridDateTimeColumnEditor = TryCast(DirectCast(e.Item, GridEditableItem).EditManager.GetColumnEditor("startDate"), GridDateTimeColumnEditor) |
| Dim startCell As TableCell = DirectCast(startColumnEditor.PickerControl.Parent, TableCell) |
| Dim compareValidator1 As New CompareValidator() |
| compareValidator1.ID = "compareValidator1" |
| compareValidator1.ControlToValidate = startColumnEditor.PickerControl.ID |
| compareValidator1.[Operator] = ValidationCompareOperator.DataTypeCheck |
| compareValidator1.Type = ValidationDataType.[Date] |
| compareValidator1.ErrorMessage = "Invalid date. " |
| compareValidator1.Display = ValidatorDisplay.Dynamic |
| startCell.Controls.Add(compareValidator1) |
| Dim compareValidator3 As New CompareValidator() |
| compareValidator3.ID = "compareValidator3" |
| compareValidator3.ControlToValidate = startColumnEditor.PickerControl.ID |
| compareValidator3.[Operator] = ValidationCompareOperator.GreaterThanEqual |
| compareValidator3.Type = ValidationDataType.[Date] |
| compareValidator3.ErrorMessage = "Date can't be earlier than today" |
| compareValidator3.ValueToCompare = DateTime.Now.ToShortDateString() |
| compareValidator3.Display = ValidatorDisplay.Dynamic |
| startCell.Controls.Add(compareValidator3) |
| End If |
| End Sub |
| Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand |
| If e.CommandName = "Update" Then |
| If Page.IsValid Then |
| e.Item.Edit = False |
| End If |
| ElseIf e.CommandName = "PerformInsert" Then |
| If Page.IsValid Then |
| e.Canceled = True |
| e.Item.OwnerTableView.IsItemInserted = False |
| e.Item.OwnerTableView.Rebind() |
| End If |
| ElseIf e.CommandName = "Delete" Then |
| End If |
| End Sub |
| <telerik:RadGrid ID="CnsGrid" runat="server" Style="position: static" AllowFilteringByColumn="True" |
| AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="15" ShowGroupPanel="True" Skin="Simple" AllowCustomPaging="True"> |
| <GroupPanel Text="Arrastre un título de columna aquí para agrupar por dicha columna"> |
| </GroupPanel> |
| <PagerStyle FirstPageToolTip="Primera página" LastPageToolTip="Ùltima Página" |
| NextPagesToolTip="Próximas Páginas" NextPageToolTip="Próxima Página" |
| PrevPagesToolTip="Página Anterior" PrevPageToolTip="Página Anterior" PagerTextFormat="Cambiar página: {4} &nbsp;Página <strong>{0}</strong> de <strong>{1}</strong>, items <strong>{2}</strong> a <strong>{3}</strong> de <strong>{5}</strong>." /> |
| <GroupingSettings CollapseTooltip="Contraer grupo" ExpandTooltip="Expandir grupo" |
| GroupContinuedFormatString="... grupo viene de la página anterior" GroupContinuesFormatString="Grupo continua en la siguiente página..." |
| ShowUnGroupButton="True" UnGroupButtonTooltip="Click aqui para desagrupar" UnGroupTooltip="Arrastre fuera para eliminar el grupo por dicha columna" /> |
| <SortingSettings SortedAscToolTip="Orden Asc" SortedDescToolTip="Orden Desc" SortToolTip="Clic aquí para ordenar" /> |
| <StatusBarSettings LoadingText="Cargando..." ReadyText="Listo" /> |
| <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> |
| <HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" /> |
| <FilterItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> |
| <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> |
| <ClientSettings EnableRowHoverStyle="True"> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| <SelectedItemStyle BackColor="#FFC080" /> |
| </telerik:RadGrid> |
| Dim ArrRes() As String = Nothing |
| Dim index As Integer |
| Session("Cns_sn_cancel") = False |
| Try |
| For index = 2 To CnsGrid.Items(Me.CnsGrid.SelectedIndexes(0)).Cells.Count - 1 |
| 'HERE I ALWAYS GET AN ERROR |
| 'BECAUSE THERE'S NO ROW SELECTED |
| ReDim Preserve ArrRes(index) |
| ArrRes(index - 2) = CnsGrid.Items(Me.CnsGrid.SelectedIndexes(0)).Cells(index).Text |
| Next |
| Session("ResConsulta") = ArrRes |
| Catch ex As Exception |
| Session("CNS_sn_error") = True |
| Session("Cns_error") = ex.Message.ToString |
| Finally |
| Dim strScript As String |
| strScript = "<script language=javascript> " |
| strScript += "window.close();" |
| strScript += "</script>" |
| ClientScript.RegisterStartupScript(Me.Page.GetType(), "CierraConsulta", strScript) |
| End Try |
In my case I don't use loading panel for AJAX requests. I use it as loading image animation. From client code I update img->src and show loading panel as it is described here:
http://www.telerik.com/help/aspnet-ajax/ajxshowhideloadingpanel.html
The only difference that I use it out ajax request.
After image is loaded (onload event) I hide panel.
It is displayed correctly if InitialDelayTime is set to 0. And doesn't being displayed at all if InitialDelayTime is not 0.
Regarding my investigation it happens by design.
Please confirm that I'm right.
Thank you.
PS: if you know more rational way to show loading animation while getting big images, please share it here :)

Currently the following works:
Any advice, help, sample code would be appreciated.
Thanks,
Lonnie