Hide or Block Time Slots

34 posts, 1 answers
  1. Denis Cilliers
    Denis Cilliers avatar
    62 posts
    Member since:
    Jan 2004

    Posted 31 Aug 2012 Link to this post

    Hi
    Is there a way to hide or grey out sections of the Scheduler time to prevent appointments being made?

    Sort of out of Office type periods or when a resource is not available?

    This sort of does things, but it gets a bit messy on the Day and Timeslot overlap.  I watned to try and get a Day to be grayed out.  Sort of if someone was on leave then the day is greyed out entirely like the Saturday and Sunday are.  But I seem to have some bug in the way it is working because the Wednesday keeps being open.

    Here is the code so far

    Private Sub radSchedulerDemo_CellFormatting(sender As System.Object, e As SchedulerCellEventArgs) Handles radSchedulerDemo.CellFormatting
           'Check Date Block
           Dim dbDateBlocked As Boolean = isDateBlocked(e.CellElement.Date)
           If dbDateBlocked Then
               e.CellElement.Enabled = False
           End If
           If isTimeBlocked(e.CellElement.Date) Then
               e.CellElement.Enabled = False
           End If
       End Sub

    Function isDateBlocked(ByVal eDate As Date) As Boolean
           Dim blReturn As Boolean = False
           'Test that the date is not in the range of blocked dates
           'Specific dates
           Dim dtBlock As Date = New Date(2012, 9, 5)
           'No Appointments in the Past
           If dtBlock < DateTime.Today Then
               blReturn = True
           End If
           If eDate.Equals(dtBlock) Then
               blReturn = True
           End If
           'Weekends
           If eDate.DayOfWeek = DayOfWeek.Saturday Then
               blReturn = True
           End If
           If eDate.DayOfWeek = DayOfWeek.Sunday Then
               blReturn = True
           End If
           Return blReturn
       End Function

    Function isTimeBlocked(ByVal eDate As DateTime) As Boolean
           Dim blReturn As Boolean = False
           Dim dtBlock As Date = New Date(2012, 9, 5)
           'Check if Day Blocked
           If eDate.Equals(dtBlock) Then
               'Block all slots for this day as a override for any other open slots by default
               Return True
               Exit Function
           End If
           'Working hours Mon - Friday
           'Block Slots 
           '   0:00 - 8:00
           Dim tsDayStart As New TimeSpan(0, 0, 0)
           Dim tsWorkStart As New TimeSpan(8, 0, 0)
           Dim tsWorkStartLate As New TimeSpan(10, 0, 0)
           '   12:00-13:00
           Dim tsLunchStart As New TimeSpan(12, 0, 0)
           Dim tsLunchEnd As New TimeSpan(13, 0, 0)
           '   17:00-24:00
           Dim tsWorkEndEarly As New TimeSpan(15, 0, 0)
           Dim tsWorkEnd As New TimeSpan(17, 0, 0)
           Dim tsWorkEndLate As New TimeSpan(19, 0, 0)
           Dim tsDayEnd As New TimeSpan(23, 59, 59)
           Select Case eDate.DayOfWeek
               Case DayOfWeek.Monday
                   If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsWorkEnd AndAlso eDate.TimeOfDay <= tsDayEnd Then
                       blReturn = True
                   End If
               Case DayOfWeek.Tuesday
                   If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay <= tsLunchEnd Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsWorkEnd AndAlso eDate.TimeOfDay <= tsDayEnd Then
                       blReturn = True
                   End If
               Case DayOfWeek.Wednesday
                   'Late working day
                   If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsWorkEndLate AndAlso eDate.TimeOfDay <= tsDayEnd Then
                       blReturn = True
                   End If
               Case DayOfWeek.Thursday
                   'Late Start of Day
                   If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStartLate Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsWorkEnd AndAlso eDate.TimeOfDay <= tsDayEnd Then
                       blReturn = True
                   End If
               Case DayOfWeek.Friday
                   'Early Working end
                   If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                       blReturn = True
                   End If
                   If eDate.TimeOfDay >= tsWorkEndEarly AndAlso eDate.TimeOfDay <= tsDayEnd Then
                       blReturn = True
                   End If
               Case DayOfWeek.Saturday
                   blReturn = True
               Case DayOfWeek.Saturday
                   blReturn = True
           End Select
           Return blReturn
       End Function

  2. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 04 Sep 2012 Link to this post

    Hello Denis,

    Thank you for contacting us.

    Please note that e.CellElement.Date contains the exact DateTime that a given cell represents. This means that the value of this property also includes a time part and the eDate.Equals(dtBlock) will return False if the time parts differ. Therefore, to overcome this, you should get only the date part of a cell's date when comparing for dates. Also, you should reset the properties that you are setting on the CellFormatting event if the used condition does not match. This is needed because the cell elements are sometimes reused to display other dates in other views and you should explicitly set Enabled = True in all cases in which your conditions are not met. The following code snippet demonstrates how to modify your CellFormatting handler in order to get this working as expected:
    Private Sub radSchedulerDemo_CellFormatting(sender As System.Object, e As SchedulerCellEventArgs) Handles radSchedulerDemo.CellFormatting
        'Check Date Block
        Dim dbDateBlocked As Boolean = isDateBlocked(e.CellElement.Date.Date) 'compare only the Date part of e.CellElement.Date
        If dbDateBlocked Then
            e.CellElement.Enabled = False
            Return
        End If
        If isTimeBlocked(e.CellElement.Date) Then
            e.CellElement.Enabled = False
            Return
        End If
     
        e.CellElement.Enabled = True 'reset the Enabled property back to True
    End Sub

    I hope you find this useful. Feel free to ask if you have any additional questions.

    Greetings,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 10 Sep 2012 Link to this post


    HI,
    Please help me to evaluate the telerik version 2012 as to give a purchase decission to my company ,
    Our customer need a scheduler to  time scale ruler to step every 2 hours  (skip one hour between each time and the next)
    or to make this row(9,11,13,15,17) height =0 so it wiil seem that it doesn't exist as follow:

    8
    10
    12
    14
    16
    18


    Best Regards
  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 11 Sep 2012 Link to this post

    Hi Khaled,

    Thank you for your question.

    Currently, RadScheduler can only be set with ruler step of at most 1 hour. I have logged your request in our Public Issue Tracking System so it is publicly available to all users. Here you can find the PITS item: http://www.telerik.com/support/pits.aspx#/public/winforms/12607.You can vote for it to increase its priority or subscribe to it to track it for any progress. As it gets more votes, we will consider implementing it a future release.

    Your Telerik points have been updated for your feature request.

    Should you have any further questions, do not hesitate to contact us.

    Regards,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  6. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 12 Sep 2012 Link to this post

    HI ,
    Thanks for Reply , Our Customer will accept this for now hopping to be modefied as soon as possible

    Another Issues that  gives me errors when i try to use it
    1-Issue that I want to use or create  events for existing fields in Appointment Edit Dialog screen.
    for example the--> (value changed event) for Start Date Time Picker
    -->or event click for the OK button
    however in visual studio design time ,
     when I seleck Ok button in Appointment Edit Dialog screen(telerik winform)  for example and open Properties window and select the lightening sign to show events possible I found many but when use the error occur ,
    So please tell me steps to use these events

    2- also I want to know the way where I can make the tool tip shows start and end time plus subject for all appointments on the scheduler


    Best Regards , thanks for your cooperation

  7. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 14 Sep 2012 Link to this post

    Hello Khaled,

    I am not sure why you are getting errors when trying to subscribe to the events of the edit dialog in the designer. I was not able to observe such issue on my end. Nevertheless, you should be able to subscribe to the events programmatically as demonstrated below:
    public class MyEditDialog : EditAppointmentDialog
    {
        public MyEditDialog()
        {
            this.buttonOK.Click += new EventHandler(buttonOK_Click);
        }
     
        void buttonOK_Click(object sender, EventArgs e)
        {
             
        }  
    }

    As to modifying the default tooltip text of the appointments, you can use the AppointmentFormatting event to achieve this:
    void radScheduler1_AppointmentFormatting(object sender, Telerik.WinControls.UI.SchedulerAppointmentEventArgs e)
    {
        e.AppointmentElement.ToolTipText = "From: " + e.Appointment.Start.ToShortDateString() + " To: "
            + e.Appointment.End + " Summary: " + e.Appointment.Summary;
    }

    I hope this will help you. Do not hesitate to ask if you have any additional questions.

    Greetings,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  8. Denis Cilliers
    Denis Cilliers avatar
    62 posts
    Member since:
    Jan 2004

    Posted 14 Sep 2012 Link to this post

    Two slight refinements to the code above

    Need to add a check for the Zero time used to display days in Month View and Timeline View, else the whole day is greyed out

    'Check if Time Sent is '00:00
           Dim zerotime As DateTime = New Date(0)
           If eDate.TimeOfDay.Equals(zerotime.TimeOfDay) Then
               Return False
           End If

    And added an event to check for the Weekend in the WeekView very useful

    Private Sub rsnMain_WeekViewClick(sender As System.Object, e As System.EventArgs) Handles rsnMain.WeekViewClick
           Me.btnChangeTimeSlots.Visible = True
           'Set Week Defaults
           Dim weekView As SchedulerWeekView = Me.radSchedulerDemo.GetWeekView()
           weekView.ShowWeekend = False
       End Sub

    Else the scheduler is looking rather good... :)
    I need to go make a Custom Dialog now ;(
  9. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 16 Sep 2012 Link to this post

    Hi,

    All worked fine , thanks for your time and great support ,your answers helps alot
    the final question is -->when I load Scheduler I group by resources (all data are from MSsql) , Resources Backcolor are Darkgrey and its forecolor are black so its not clear atall ,
    even if i changed the schedule theme the resources  color stays grey
    I tried the following code but its not working in the load it may work in a  button click after load
     ,so the first impression to customer that resources are unreadable till he click on the button


    Dim
    i As Integer

    Dim colors() As Color = {Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.Red, Color.Orange, Color.Pink, Color.Purple, Color.Peru, Color.PowderBlue}

     

    For Each r As Resource In RadScheduler1.Resources

    i += 1

    r.Color = colors(i)

    Next

     Best Regards

     

     

     

     

     

     

     

     

     

     

     

     

     

  10. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 17 Sep 2012 Link to this post

    Hello Khaled,

    The code you have posted is correct and it should apply the different colors to the corresponding resources. Please make sure that the resources are already populated at the moment you assign the colors (i.e. you have already set the datasource to RadScheduler and filled the data tables by calling the Fill method of their table adapters). For example, you can try assigning the colors on the Shown event of the form.

    I hope this will help. Please let me know if you need any further assistance.

    Regards,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  11. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 20 Sep 2012 Link to this post

    Hi,
        Thanks alot All are fine , with your help all problems solved till now,
    there is another 2 Question
     1-about preventing drag and drop in holidays
    -now what i managed to do is to allow drag and drop in holidays then loop on all appointments if there is an appointment with

    For Each a As Appointment In RadScheduler1.Appointments

    a.start.Dayofweek.tostring ="Sunday" i prevent save

    -but will be better to prevent drag and drop the appointment in holidays

    2- Also I want to get the AppointmentID for the selected Appointment ,which event could I use


    Best Regards

     

     

     

  12. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 21 Sep 2012 Link to this post

    Hi Khaled,

    You can handle the AppointmentDropping event to check if new target date is a holiday and cancel the drop if needed:
    Private Sub radScheduler1_AppointmentDropping(sender As Object, e As AppointmentMovingEventArgs) Handles radScheduler1.AppointmentDropping
        If e.NewDate.DayOfWeek = DayOfWeek.Saturday OrElse e.NewDate.DayOfWeek = DayOfWeek.Sunday Then
            e.Cancel = True
        End If
    End Sub

    Feel free to ask if you have any additional questions.

    Regards,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  13. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 23 Sep 2012 Link to this post

    Hi ,

         till now all are going well with your help , wishing the following 4 questions will be the last
    1- if we bought 2012 version will we obtain a liscence so that we will be able to develop programs using telerik and sell it to our customers legaly , as my company owner want to confirm about this
    2-ColorCoding for time slots to set
    -->Set any clor for working times ,example from (8AM till 2PM) then (4PM till PM) 
    3-->Set different color for Break times (2PM till 4PM)
    -can i make in the dayview the resources on the vertical access and the time the horizontal
    4- in the appointments table I added an integer column "X"  i want to pass this column to the schedulerbindingsource ,
    but what i think is that field like description in SchedulerBindingDatasource accepts string only as when i assign to it a string i managed to call its value in runtime but when assign integer column "X" I couldn't use it in run time the value is ""

    Regards ,
    Khaled
  14. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 26 Sep 2012 Link to this post

    Hi Khaled,

    Yes, if you purchase a license for RadControls, you can create and sell software that contains our components as long as you deploy your application in accordance with our license agreement. Please refer to the following documentation article where you can find the permitted ways to deploy your application: http://www.telerik.com/help/winforms/installation-deployment-and-distribution-redestributing-telerik-radcontrols-for-windows.html

    As to your question about coloring the cells, to apply conditional colors you can use the CellFormatting event of RadScheduler. The following code snippet demonstrates a sample implementation:
    Private Sub radScheduler1_CellFormatting(sender As Object, e As Telerik.WinControls.UI.SchedulerCellEventArgs) Handles radScheduler1.CellFormatting
        If e.CellElement.[Date].Hour >= 12 AndAlso e.CellElement.[Date].Hour <= 14 Then
            e.CellElement.BackColor = Color.Green
        ElseIf e.CellElement.IsWorkTime Then
            e.CellElement.BackColor = Color.Red
        Else
            e.CellElement.ResetValue(SchedulerCellElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local)
        End If
    End Sub

    As to the orientation of resources/time scale in grouped DayView, it cannot be modified. However, you can use the TimelineView which arranges the resources vertically and the timescale horizontally. You can check the Grouping example in our Examples application. I have also attached a screenshot which demonstrates this.

    In regards to your forth questions, I am not sure I completely understand your scenario. Generally, you can map any custom column of your database to any custom field of your appointment and the following help article explains how you can achieve this: http://www.telerik.com/help/winforms/scheduler-data-binding-binding-to-custom-fields.html. Also, if you need to do some type conversion between the data in the datasource and the fields of the appointments (for example, convert the integer column X to the string field Description and vice versa) you can use conversion abilities of the scheduler mapping. This is demonstrated in the following help article: http://www.telerik.com/help/winforms/scheduler-data-binding-scheduler-mapping.html

    A bit off-topic, I would kindly ask you to open new threads for questions that are not related to the original topic of the current thread. This will help us track your questions better and provide you with quicker responses. Also, it will help other user with the same questions find their answers more easily.

    Thank you for your understanding. If you have further questions, do not hesitate to ask.

    Kind regards,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  15. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 01 Oct 2012 Link to this post

    Hi ,
        thanks alot for your reply,it is highly appreciated and the one of the most valuable element in my company's purchase decession,
    -->concerning Cell formatting event and appointment dropping will help me in many cases
    -->I got 3 question concerning Timeline with the hours scale on horizontal axis and resources on vertical axis:

    q1- if i got six appointments for the resource1 and i show on the horizontal axis 10 resources , around 3 appointments only will be visible and the other will be hidden , why don't they auto shrink, and how user can see them(example is in the attachment)

    q2-if i wantthe code that do ( rightclick in on the horizontal axis in the timeline tab and select hours instead of days as your previous attachment)

    q3-as you can see in my attachment the horizontal axis in the timeline view is divided in to around 6 time slots
    per each page , in the first from 00 till 05 in second from 06 till 12 .....etc,
    what i need here is to maket it for example 10 time slots instead of 6
    as page 1 to start at 00 and ends at 10 and page 2 starts at 11and ends at at 20 ...etc

    -->or make all hours in 1 page from 00 till 24

  16. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 01 Oct 2012 Link to this post

    -->Also if i use minutes to be my range factor as follow

    dayView.RangeFactor = 1

    -->then i want each 1 minute row to have a smaller height so i tried the following but doesn't work

    dayView.RulerScaleSize = 10

    so the question is how to control row height by code


  17. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 02 Oct 2012 Link to this post

    Hello Khaled,

    I am glad I was able to help.

    As to your new questions, when there are more appointments than a row in TimelineView can hold, a small scroll bar should appear at the end of that row (as shown on the attached screenshot). Auto-shrink is not supported because this would make the text of the appointments unreadable.

    In regards to the second question, you can set the scaling programmatically using the following code:
    this.radScheduler1.GetTimelineView().ShowTimescale(Timescales.Hours);

    As to the third question, you can modify the number of displayed cells using the following property:
    this.radScheduler1.GetTimelineView().GetScaling().DisplayedCellsCount = 10;

    In regards to your last question, this is the correct way to modify the row height and it works correctly on my end:
    this.radScheduler1.GetDayView().RangeFactor = (ScaleRange)1;
    this.radScheduler1.GetDayView().RulerScaleSize = 10;

    However, please note that setting the RangeFactor to 1 will cause RadScheduler to create thousands of cell elements which will significantly decrease the performance.

    I hope I was able to answer your questions. If you continue experiencing difficulties, you can open a new support ticket and send us a sample project which demonstrates your current approach. This will let us investigate it and provide you with proper support.

    Greetings,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  18. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 04 Oct 2012 Link to this post

    Hi ,
         All were fine thanks alot , I will show Owners how things are meeting there customer need and purchase 2012 version 



    Best Regards
    Khaled
  19. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 04 Oct 2012 Link to this post

    Hi ,
    all your previous solution worked fine except that concerning the scroll on the right you showed me in your previous attachment  it doesn't show when appointments per resource increase than the row height in timelineview ,

    shall i need a code like the following to let the scroll show or it shows automatically          
    Dim TMvW As SchedulerTimelineView = RadScheduler1.GetTimelineView

    TMvW.AllowResourcesScrolling = True

     TMvW.AllowAppointmentResize() = True

    please help ,i tried this with no hope , and I want to show the owners the demo that makes all their dreams come true , but why this is not working however i installed your final version demo and working on it
    but no scroll appears is there is a certain property to set it for the scheduler or what??

    here i reattached your previous attachment(scroll at right.png ) , and anothe attachment(Scheduler Prob.Jpg) for what i have

    Best Regards in Advance
    Khaled

     

     


  20. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 05 Oct 2012 Link to this post

    Hello Khaled,

    It appears that there is an issue in the Breeze theme which is preventing the scroll bars from appearing. We will address this issue in the next official release which is expected by the end of the month. For the time being, I am sending you a modified version of the Breeze theme which will allow the scrollbars to appear. Sample project is also included. Note that in order to be able to load the package file, its build action must be "Embedded resource". More information about loading custom themes can be found in the following help article.

    Your Telerik points have been updated for bringing this issue to our attention. Should you have any additional questions, do not hesitate to ask.

    All the best,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  21. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 05 Oct 2012 Link to this post

    Hi ,

      Thanks for reply
    -->So to get the Breeze theme working I have to purchase on the first of November not before.
    -->Also I will try Your attachment and feed you back

    -->Note that you may put in consideration when I changed the row height in the dayview by code ruler Scale Size ,It doesn't work till I go to week or timeline view then get back to day view by code as follow and the the row height modification shows :

     

    Me.RadScheduler1.ActiveViewType = SchedulerViewType.WorkWeek

     

    Me.RadScheduler1.ActiveViewType = SchedulerViewType.Day

    is this about the breeze i may try without , but the breeze color suits our application most so if will be fixed we will by that fixed one


    Best Regards
    Khaled
  22. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 07 Oct 2012 Link to this post

    Hi ,
    I embeded the Breeze modified theme successfuly with your helpful sent materials ,i showed the owners a demo , All was great , their only comment was :
    --> When I increase number of resources per view  the resource names couldn't be fully dispalyed could we have the ability to wrap resources text Header in the Timeline View as attached
    -->In the day view i can set start and end time on the ruler as folow
    Me.RadScheduler1.GetDayView.RulerStartScale = 8
    Me.RadScheduler1.GetDayView.RulerEndScale = 13

    But if i witched to timeline view and make the Timescale to show by hours, how could I set the starting hour and ending hour like on the Dayview

     

     


    Best regards
    Khaled
  23. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 08 Oct 2012 Link to this post

    Hi Khaled,

    The text of the resource headers cannot be wrapped if it is vertically oriented. However, you can change the orientation of the text to horizontal and then use the CellFormatting event to set TextWrap to the cells. You can also modify the resources' width so that it is wide enough to display the text properly.

    As to your second question, the TimelineView displays dates/times continuously and to modify the start time, you should set the StartDate property of the current view with an exact DateTime. To modify the number of cells displayed, you can use the DisplayedCellsCount property as discussed in a previous message.

    I am attaching a sample project to demonstrate these. I hope you find it useful.

    Should you have any additional questions, do not hesitate to ask.

    Regards,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  24. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 08 Oct 2012 Link to this post

    Hi ,
    thanks this project sample was perfect , my last question is

    1-If  I want to use the cell formatting to
      --> shade cells by red on (Date 22/09/2012) , on (time  between 10 to 13) , for the (resource "Alan Smith")
      --> shade cells by Green on (Date 22/09/2012) , on (time  between 08 to 18) , for the (resource "Anne Dodsworth")

    I tried doing this but no hope , so please help

    Best Regards,
    Khaled
  25. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 10 Oct 2012 Link to this post

    Hi Khaled,

    You can get all the information you need from the cell in order to determine the back color. The following code sample demonstrates this:
    Private Sub RadScheduler1_CellFormatting(sender As Object, e As SchedulerCellEventArgs)
        Dim resourceName = ""
         
        If e.CellElement.View.GetResources() IsNot Nothing Then
            resourceName = e.CellElement.View.GetResources()(0).Name
        End If
         
        Dim targetDate as New DateTime(2012, 09, 22)
     
        If e.CellElement.Date.Date = targetDate AndAlso e.CellElement.Date.Hour >= 10 AndAlso e.CellElement.Date.Hour <=13 AndAlso resourceName = "Alan Smith" Then
            e.CellElement.BackColor = Color.Red
        ElseIf e.CellElement.Date.Date = targetDate AndAlso e.CellElement.Date.Hour >= 08 AndAlso e.CellElement.Date.Hour <=18 AndAlso resourceName = "Anne Dodsworth" Then
            e.CellElement.BackColor = Color.Green
        Else
            e.CellElement.ResetValue(SchedulerCellElement.BackColorProperty, ValueResetFlags.Local)
        End If
     
    End Sub

    Please let me know if you have any additional questions.

    Regards,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  26. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 05 Nov 2012 Link to this post

    Hi,
    our scheduler was under test using our data for along time all are ok but 2 needs occured
    1- In the resources Timelineview as in (attacment 1)
     -->i want to display the image stretched plus the name of the resource
    -->also is it possible to or fix the image height and width while it is stretched
    -->is it possible to put the image in a frame and if possible so how this could be done
    2- I want to hide the scheduler  horizontal scroll as in (attachment 2)
     
    Best Regards and always thankful for cooperation
    Khaled
  27. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 07 Nov 2012 Link to this post

    Hi Khaled,

    You can change the ImageLayout property of the resource cells using the CellFormatting event. As to putting a frame to the image, this should be done in the image itself. In regards to hiding the horizontal scrollbar, there is a single property that sets this. I am attaching a small sample project which demonstrates the discussed features.

    A bit off-topic, I would like to remind you that your trial support package has expired. If you would like to continue receiving support from us, you will have to consider a purchase of some of the licenses that we offer. In case your company has already purchased the product, please ask the purchase holder to add you as a License Developer to the purchase. This will give you full access to the products your company has purchased, to our downloads section, and to our support ticketing system. Additionally, all your questions will be reviewed according to the license you have. More information on License Developers you can find here: http://www.telerik.com/account/faqs.aspx.

    Feel free to ask if you have any questions.

    Regards,
    Ivan Todorov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  28. Khaled
    Khaled avatar
    16 posts
    Member since:
    Sep 2012

    Posted 12 Nov 2012 Link to this post

    Hi,

    Owners decided to buy the latest Telerik stable  Version 
    So please advise which version is suitable shall we work with Q2 2012 or get Q3
    Also what about the price
    Note
    ====
    1-in your comment -->Posted on Oct 5, 2012 on this page you mentioned that there are some telerik points that may give a disount bon your product
    2-Our used version of visual studio is:
    Microsoft Visual Studio 2010
    Version 10.0.30319.1 RTMRel
    Microsoft .NET Framework
    Version 4.0.30319 RTMRel

    Best Regards,
    Khaled
  29. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 13 Nov 2012 Link to this post

    Hi Khaled,

    I suggest using the latest version as with each new release we improve our product and address issues that were present in the previous releases. When you purchase a license, you will receive access to the current Telerik version as well as all Telerik versions that will be released during your subscription. Additionally, upon request we can provide you with older versions as well.

    As to the Telerik points, yes, you can redeem them as a discount to your purchase. You can read more about Telerik points here: http://www.telerik.com/telerik-points.aspx. For a list of available purchase options, please visit this link: http://www.telerik.com/purchase.aspx.

    For any further questions regarding the purchase, please contact sales@telerik.com.

    Kind regards,
    Ivan Todorov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  30. Chan
    Chan avatar
    14 posts
    Member since:
    Nov 2012

    Posted 10 Jul 2013 Link to this post

    Helo !
    As per requirement, I need to display appointments for 14 days on Radscheduler without weekends.
     tried with weekview but that is displaying only 1 week view.
    I tried Dayview with daycount as 14, that displays 14 days but displaying saturday and sunday as well.
    I tried MultidayView as well, but not getting idea to hide weekends.
    Here is my code snippet :

    private void FormAppointment_Load(object sender, EventArgs e)
            {
                SetRadScheduler();
            }
     
            private void SetRadScheduler()
            {
                SchedulerDayView dayView = new SchedulerDayView();
                dayView.DayCount = 14;
                this.radScheduler1.ActiveView = dayView;
     
                //SchedulerWeekView weekView = new SchedulerWeekView();
                //weekView.DayCount = 3;
                //weekView.ShowWeekend = false;
                //this.radScheduler1.ActiveView = weekView;
     
                //radScheduler1.ActiveViewType = SchedulerViewType.Month;
                //(radScheduler1.ActiveView as SchedulerMonthView).WeekCount = 2;
     
                //radScheduler1.ActiveViewType = SchedulerViewType.WorkWeek;
                //(radScheduler1.ActiveView as SchedulerWeekView).DayCount = 12;
            }
     
     private void radScheduler1_CellFormatting(object sender, SchedulerCellEventArgs e)
     {
     if (e.CellElement.Date.DayOfWeek == DayOfWeek.Saturday || e.CellElement.Date.DayOfWeek == DayOfWeek.Sunday)
     {
       //e.CellElement.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
      //e.CellElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
        e.CellElement.Enabled = false;
     }
     else
     {
      //e.CellElement.Visibility = Telerik.WinControls.ElementVisibility.Visible;
        e.CellElement.Enabled = true;
    // e.CellElement.Size = e.CellElement.DefaultSize;
     }
    }

    Snapshot of current output : where i want to hide saturday and sunday
  31. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 11 Jul 2013 Link to this post

    Hello Chan,

    Thank you for writing.

    Our RadScheduler does not offer property to hide the weekends in MultiDayView and in DayView. However, you can achieve the desired functionality by using the MultiDayView, where you can set ranges of dates you want to show e.g. one range from 07.07 to 12.07 and another range from 15.07 to 20.07. For more information about this please, refer to this help article.

    I hope you find this useful.

    Regards,
    Peter
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready