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

RadTimePicker1.TimeView.DataList.DataSource Not Working

2 Answers 71 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 09 Sep 2009, 10:19 PM
RadTimePicker1.TimeView.DataList.DataSource Not Working inside Radgrid template.  Heres my itemdatabound code:
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)  
        If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then  
            Dim item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)  
            
            Dim tmeStart As RadTimePicker = DirectCast(item.FindControl("tmeStart"), RadTimePicker)  
             
 
        Dim arrayList As New ArrayList  
        Dim dte As DateTime = CDate(Now.ToShortDateString)  
        arrayList.Add(dte.AddHours(14))  
        arrayList.Add(dte.AddHours(14).AddMinutes(15))  
        arrayList.Add(dte.AddHours(14).AddMinutes(30))  
        arrayList.Add(dte.AddHours(14).AddMinutes(45))  
 
        arrayList.Add(dte.AddHours(15))  
        arrayList.Add(dte.AddHours(15).AddMinutes(15))  
        arrayList.Add(dte.AddHours(15).AddMinutes(30))  
        arrayList.Add(dte.AddHours(15).AddMinutes(45))  
 
        arrayList.Add(dte.AddHours(16))  
        arrayList.Add(dte.AddHours(16).AddMinutes(15))  
        arrayList.Add(dte.AddHours(16).AddMinutes(30))  
        arrayList.Add(dte.AddHours(16).AddMinutes(45))  
 
        arrayList.Add(dte.AddHours(17))  
        arrayList.Add(dte.AddHours(17).AddMinutes(15))  
        arrayList.Add(dte.AddHours(17).AddMinutes(30))  
        arrayList.Add(dte.AddHours(17).AddMinutes(45))  
 
 
            tmeStart.TimeView.DataList.DataSource = arrayList 
              
 
            
        End If  
    End Sub 
I can do change of time view when timepicker is not inside radgrid template. Is there a way to do this also when timepicker is inside radgrid and using template? Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
RJ
Top achievements
Rank 1
answered on 09 Sep 2009, 11:06 PM
Was able to solve my problem:  Code should be placed inside itemCreated not itemDatabound
0
Chandrasekhar
Top achievements
Rank 1
answered on 09 Mar 2012, 05:31 AM
Need to bind the ArrayList to TimeView
tmeStart.TimeView.DataList.DataBind()
 
Tags
Calendar
Asked by
RJ
Top achievements
Rank 1
Answers by
RJ
Top achievements
Rank 1
Chandrasekhar
Top achievements
Rank 1
Share this question
or