question on timeslot.controls.enabled

2 posts, 0 answers
  1. Martin Gartmann
    Martin Gartmann avatar
    51 posts
    Member since:
    Apr 2004

    Posted 17 Dec 2008 Link to this post

    Dear all,

    i have a question about timeslot.controls.enabled. I use the following code to set the CssStyle for a timeslot.

    The apparence part is working as it should be, but also when a timeslot.control.enabeld = false it is still possible to insert new appoinments in this place.

    As far as i understood, this parameter should control/Stop edit/insert on the timeslot.

    What is wrong in my case.

        Protected Sub rsAll_TimeSlotCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.TimeSlotCreatedEventArgs) Handles rsAll.TimeSlotCreated  
            ' die Sichtbarkeit und den Zugriff in Anhängigkeit der Resource zu steuern  
            ' 1 - None, 2 - View, 3 - Edit  
            If e.TimeSlot.Start < Now Then  
                e.TimeSlot.Control.Enabled = False 
            ElseIf e.TimeSlot.Resource.Text = "DRX-600" And Session("myDRX600") = 3 Then  
                e.TimeSlot.Control.Enabled = True 
            ElseIf e.TimeSlot.Resource.Text = "DRX-600" And Session("myDRX600") = 2 Then  
                e.TimeSlot.Control.Enabled = False 
            ElseIf e.TimeSlot.Resource.Text = "DRX-400" And Session("myDRX400") = 3 Then  
                e.TimeSlot.Control.Enabled = True 
            ElseIf e.TimeSlot.Resource.Text = "DRX-400" And Session("myDRX400") = 2 Then  
                e.TimeSlot.Control.Enabled = False 
            ElseIf e.TimeSlot.Resource.Text = "DSX-400" And Session("myDSX400") = 3 Then  
                e.TimeSlot.Control.Enabled = True 
            ElseIf e.TimeSlot.Resource.Text = "DSX-400" And Session("myDSX400") = 2 Then  
                e.TimeSlot.Control.Enabled = False 
            ElseIf e.TimeSlot.Resource.Text = "DPX-250" And Session("myDPX250") = 3 Then  
                e.TimeSlot.Control.Enabled = True 
            ElseIf e.TimeSlot.Resource.Text = "DPX-250" And Session("myDPX250") = 2 Then  
                e.TimeSlot.Control.Enabled = False 
            ElseIf e.TimeSlot.Resource.Text = "DPX-200" And Session("myDPX200") = 3 Then  
                e.TimeSlot.Control.Enabled = True 
            ElseIf e.TimeSlot.Resource.Text = "DPX-200" And Session("myDPX200") = 2 Then  
                e.TimeSlot.Control.Enabled = False 
                e.TimeSlot.Control.Enabled = False 
            End If  
            If e.TimeSlot.Control.Enabled = True Then  
                e.TimeSlot.CssClass = "Enabled" 
            ElseIf e.TimeSlot.Control.Enabled = False Then  
                e.TimeSlot.CssClass = "Disabled" 
            End If  
        End Sub 

  2. Peter
    Peter avatar
    6637 posts

    Posted 17 Dec 2008 Link to this post

    Hi Martin,

    Setting e.TimeSlot.Control.Enabled = False will disable any server controls in this time slot. However, you can still double click on it to envoke the inline or the advanced form.

    If you want to disalbe certain time slots, you should use this kb article: 

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
Back to Top