Status Indicator

7 posts, 0 answers
  1. Chris Scallion
    Chris Scallion avatar
    9 posts
    Member since:
    Jun 2010

    Posted 17 Jan 2011 Link to this post

    Is there a way to increase the status indicator width for appointments?
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 19 Jan 2011 Link to this post

    Hi Chris,

    Please could you show with a screenshot or explain in further detail what you would like to change and I will do my best to help
    thanks
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Chris Scallion
    Chris Scallion avatar
    9 posts
    Member since:
    Jun 2010

    Posted 19 Jan 2011 Link to this post

    Sure.... see the png...
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 19 Jan 2011 Link to this post

    Hi Chris,

    Unfortunatly, I haven't been able to find a way to do this. It seems that this part of the appointment is painted using a StatusBrush as part of the AppointmentElement and cannot be changed.
    You can however set your own status types in the following way:
    Me.RadScheduler1.Statuses.Clear()
    Me.RadScheduler1.Statuses.Add(New AppointmentStatusInfo(1, "In Office", Color.Green, Color.Orange, AppointmentStatusFillType.Solid))

    I hope that helps
    Richard
  6. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 20 Jan 2011 Link to this post

    Hi Chris Scallion,

    Thank you for writing.

    At the moment this property is not exposed, but you can access it through reflection. The code snippet bellow changes the value of the private field appointmentTypeAreaWidth which contains the width of the status area.
    void radScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
    {
        typeof(AppointmentElement).GetField("appointmentTypeAreaWidth", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(e.AppointmentElement, 15);
    }

    If you have other questions, do not hesitate to contact me.

    Greetings,
    Dobry Zranchev
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  7. Richard
    Richard avatar
    32 posts
    Member since:
    Aug 2010

    Posted 12 Oct 2011 Link to this post

    Hello Dobry,

    I found that the suggested solution using reflection does not work if the Scheduler is displaying appointment in Resources mode.
    Here is my code:
    Private Sub radScheduler1_AppointmentFormatting(sender As Object, e As SchedulerAppointmentEventArgs) Handles radScheduler1.AppointmentFormatting
           
        Type.GetType("AppointmentElement").GetField("appointmentTypeAreaWidth", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic).SetValue(e.AppointmentElement, 10)
     
    End Sub

    Am I missing something? Or this does not indeed work in Resources mode?

    Thanks.



  8. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 14 Oct 2011 Link to this post

    Hi Richard,

    Thank you for your question.

    I confirm that running the code you have provided results in an Object reference exception. The problem seems to be in the C# to VB conversion. Please try the following code:
    Private Sub radScheduler1_AppointmentFormatting(sender As Object, e As SchedulerAppointmentEventArgs) Handles radScheduler1.AppointmentFormatting
            GetType(AppointmentElement).GetField("appointmentTypeAreaWidth", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic).SetValue(e.AppointmentElement, 10)
        End Sub

    I hope this helps. Should you have further questions, feel free to ask.

    Regards,
    Ivan Todorov
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top
UI for WinForms is Visual Studio 2017 Ready