RadTimePicker1.TimeView.DataList.DataSource Not Working

3 posts, 0 answers
  1. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 09 Sep 2009 Link to this post

    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. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 09 Sep 2009 Link to this post

    Was able to solve my problem:  Code should be placed inside itemCreated not itemDatabound
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chandrasekhar
    Chandrasekhar avatar
    6 posts
    Member since:
    Aug 2011

    Posted 08 Mar 2012 Link to this post

    Need to bind the ArrayList to TimeView
    tmeStart.TimeView.DataList.DataBind()
     
Back to Top