Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
266 views

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

waruni
Top achievements
Rank 1
 answered on 23 Feb 2010
3 answers
280 views
Hi,

Im not sure whether this should go under the Radgrid section or the RadWindow section, but here goes.

I have a RadGrid on a RadWindow and would like to know if its possible to use the popup edit form, to edit items in the RadGrid.
I have tried this and instead of the popup appearing, the RadWindow disappears and the screen goes grey as it would if the editform had appeared, but it doesn't appear.

Any help would be much appreciated,

Cheers
Tsvetoslav
Telerik team
 answered on 23 Feb 2010
2 answers
227 views
Hi, is it possible to close a RadWindow by just clicking outside of it on the screen/parent window?

I have tried searching for such functionality, but haven't been able to find it.

Tried to do it by creating an onclick-function on the body of the parent page, that searches for any active RadWindow and closes it if found. This kind of works - BUT it closes the window just as it's getting opened too, so for a user the screen just flickers as the window opens and closes again immediately.

Would be grateful for any help here.

Hans Gunnar
Top achievements
Rank 1
 answered on 23 Feb 2010
7 answers
243 views
hi all,

i have a GridDateTimeColumn in a grid, i added compare validators for it in the code like the example here http://www.telerik.com/help/aspnet-ajax/grdvalidation.html, one to check the type, and another to compare it with Date.Now

the problem is that the validator that checks the type works only on insert but not on update! i can't find any logical reason for that..here is my code

<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 ObjectByVal 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 ObjectByVal 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 

"compareValidator1" is the one that is not working on update, when i enter string characters in the date field and click on update button it performs updating process, it considers the page as valid

Any ideas?? wht am i doing wrong??

thnx in advance
Tsvetoslav
Telerik team
 answered on 23 Feb 2010
1 answer
140 views
hi,
  I am  using file explorer and using radUpload for uploading the files...what I want when the new form is open for uploading the file, and when the user click the ok button the progress should be shown how much file is uploaded...I using the rad AjaxUploadingPanel but i didnt fullfill my requirement...I use radProgressbar i also didnt fullfill my requirement...how can it done??when the user upload the file the progress bar is shown and it depends upon the size of file as well like if the file takes 30 minutes for upload the progress bar should be shown according to that..........

regards
samee javaid 
T. Tsonev
Telerik team
 answered on 23 Feb 2010
7 answers
189 views
I am working with a Grid. I use the client side row selection but, when I try to get the selected item (server side) the "SelectedIndexes.count" is always 0 (zero) although I have a row selected. What can I do???

DGRID CODE
<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&#237;tulo de columna aqu&#237; para agrupar por dicha columna"
            </GroupPanel> 
            <PagerStyle FirstPageToolTip="Primera p&#225;gina" LastPageToolTip="&#217;ltima P&#225;gina" 
                NextPagesToolTip="Pr&#243;ximas P&#225;ginas" NextPageToolTip="Pr&#243;xima P&#225;gina" 
                PrevPagesToolTip="P&#225;gina Anterior" PrevPageToolTip="P&#225;gina Anterior" PagerTextFormat="Cambiar p&#225;gina: {4} &amp;nbsp;P&#225;gina &lt;strong&gt;{0}&lt;/strong&gt; de &lt;strong&gt;{1}&lt;/strong&gt;, items &lt;strong&gt;{2}&lt;/strong&gt; a &lt;strong&gt;{3}&lt;/strong&gt; de &lt;strong&gt;{5}&lt;/strong&gt;." /> 
            <GroupingSettings CollapseTooltip="Contraer grupo" ExpandTooltip="Expandir grupo" 
                GroupContinuedFormatString="... grupo viene de la p&#225;gina anterior" GroupContinuesFormatString="Grupo continua en la siguiente p&#225;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&#237; 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> 


VB CODE
        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 

Daniel
Telerik team
 answered on 23 Feb 2010
2 answers
134 views
I have un RadComboBox in DetailTables of the RadGrid. I would like to find the items where the event fired.

Thanks,
Ines
Inessa Parfjonova
Top achievements
Rank 1
 answered on 23 Feb 2010
1 answer
93 views

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 :)

Dimo
Telerik team
 answered on 23 Feb 2010
3 answers
128 views


Hi all,

I was attempting to add an additional item to a radpanel dropdown using this method.  After getting a Telerik not define javascript error, I found docs relating to Add/Remove RadControls to the Global Assembly Cache - indeed it references the Telerik.Web.UI. assembly which I should be able to find in a bin folder - but it is not there.  There are plenty of Telerik references in my solution, but they are there to support what is going on, not this thing I want to do. 

Do I have a different version (not sure how to determine this) than what would be appropriate with this method? 

Do I need to find which developer committed the assemblies to my solution and get the Telerik.Web.UI one?

All the methods and docs in the Telerik site seem reasonable and straight forward, I am guessing I just need to either install locally or get the dll from the other developer and add it to my solution.

Can someone help me get started?

Thanks!

Troy


function AddNewItem()
{   
 var panelbar = $find("<%= RadPanelBar1.ClientID %>");
 var panelItem
= new Telerik.Web.UI.RadPanelItem();
 panelItem.set_text(
"New Item");
 panelbar.trackChanges();
 panelbar.get_items().add(panelItem);
 panelbar.commitChanges();        
}

Peter
Telerik team
 answered on 23 Feb 2010
1 answer
113 views
I'm trying to use a rad window as an input form to add and update categories. I'm using the new Content Template to define my form instead of loading an external page.

The following is what I'm trying to achieve:

  • 100% Ajax - No flickering
  • Ability to retrieve the value of a textbox via server side code
  • Ability to close the window after saving or canceling
  • Ability to reopen window to add / edit additional data after closing window
  • Ability to set the value of a textbox in the form when editing

Currently the following works:

  • Retrieve the value of a textbox via server side code
  • Can close the window if content template does not contain a Rad Ajax Panel. (Rad Ajax Panel is the only way I have found to  prevent screen flicker when clicking Save / Cancel buttons)
  • If window is closed, clicking button to reopen it does not work

Any advice, help, sample code would be appreciated.

Thanks,

Lonnie

 



Svetlina Anati
Telerik team
 answered on 23 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?