Scheduler Navigator Text

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

    Posted 08 Mar 2013 Link to this post

    Is there a way to change the Navigation text for the Month view to not show the dates but rather the month as in Outlook


  2. Answer
    Matias
    Matias avatar
    13 posts
    Member since:
    Jan 2013

    Posted 08 Mar 2013 Link to this post

    Hi Denis

    You can handle the RadScheduler ActiveViewChanged event and check if the new view type equals to SchedulerViewType.Month. If the new type equals to SchedulerViewType.Month then you can change the DateFormat property of the RadSchedulerNavigator to something like "MMMM yyyy".

    The code inside ActiveViewChanged event will be something like:
    if (e.NewType.ViewType == SchedulerViewType.Month)
    {
        RadSchedulerNavigator1.DateFormat = "MMMM yyyy"
    }
    else
    {
        RadSchedulerNavigator1.DateFormat = "dd MMMM yyyy"
    }

    I know the code I provided doesn't match exactly Outlook look, but since RadScheduler can scroll months and have half a month (lets say Half January and Half February) in view at the same time, this is the easiest and practical solution that comes to my mind right now.

    Please, let me know if this solution works for you.

    Regards,
    - Matias.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 12 Mar 2013 Link to this post

    Hin guys,

    I can confirm that Matias's approach is the right way to go in this case.

    Thank you Matias for your time and effort. Your Telerik Points have been updated accordingly.
     
    Kind regards,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  5. Denis Cilliers
    Denis Cilliers avatar
    62 posts
    Member since:
    Jan 2004

    Posted 20 Mar 2013 Link to this post

    One issue wit the solution is that it displays two month names instead of just one

    How would we eliminate the second month and just display the main one 

    monthview header text_2.png is how Outlook displays the Month Name
    monthview header text_3.png is how it currently displays 

    Any help would be appreciated




  6. Matias
    Matias avatar
    13 posts
    Member since:
    Jan 2013

    Posted 21 Mar 2013 Link to this post

    Hi Denis,

    As I stated in my previous post, I don't really think that will be easily achieved. RadScheduler has the ability to scroll through months using the mouse wheel, and it can have two months displaying at the same time, so, for example, it can be displaying the 10th of January and the 1st of February at the same time. That's why RadNavigator displays 2 months, being January-January if only January is visible, or January-February following my previous example.

    For sure Stefan will correct me if I'm wrong and will provide you with a solution or a better explanation if needed.

    Sorry I cannot help you on this one.
     - Matias
  7. Denis Cilliers
    Denis Cilliers avatar
    62 posts
    Member since:
    Jan 2004

    Posted 22 Mar 2013 Link to this post

    Hi Guys

    I'm not looking to change the way the diary works, just the text. I'm quite happy with what it displays, if you look at my original request you will see that I'm trying to display just one month name for the view

    Having January 2013 - March 2013 for the month of February 2013, just because you have the last few days of January and the first few days of March is not what users expect.  So while it is technically correct, a user does not think in technical terms and wants February to display. Add to this the same users use Outlook everyday there is a certain expectation of what this should look like.

    Hence I have a Bug open from our testers saying that my diary is showing the wrong month name, so while it is showing the right names technically, they don't really care and want it changed, and hence my question on how can I change what is displayed in the text.

    Thanks
    Denis
  8. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 25 Mar 2013 Link to this post

    Hi Denis,

    Currently, this is the way RadScheduler works - by displaying the currently displayed start and end date periods. If you want to customize this behavior, you can set the desired text to the label in the TextChanged event for example:
    AddHandler radSchedulerNavigator1.DateLabelElement.TextChanged, AddressOf DateLabelElement_TextChanged;

    Private Sub DateLabelElement_TextChanged(sender As Object, e As EventArgs)
        If radScheduler1.GetMonthView() IsNot Nothing Then
            radSchedulerNavigator1.DateLabelElement.Text = radScheduler1.GetMonthView().StartDate.ToString("MMM yyyy", System.Globalization.CultureInfo.InstalledUICulture)
        End If
    End Sub

    I hope this helps.

    Regards,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  9. Denis Cilliers
    Denis Cilliers avatar
    62 posts
    Member since:
    Jan 2004

    Posted 25 Mar 2013 Link to this post

    Hi Stefan

    I can see what you are trying to do, but you missed one issue and would end up with Feb-2013 for the month of Mar-2013.  
    My users would be impressed, my Boss on the other hand might not be 

    but it is simple to fix 
    Private Sub DateLabelElement_TextChanged(sender As Object, e As EventArgs)
     
            If rsScheduler.GetMonthView() IsNot Nothing Then
     
                Dim monthNameDate As DateTime = rsScheduler.GetMonthView().StartDate.AddDays(8)
                snMainNav.DateLabelElement.Text = monthNameDate.ToString("MMM yyyy", System.Globalization.CultureInfo.InstalledUICulture)
     
            End If
     
        End Sub

    So thank you for all the help ...

    So back to the grind stone for me 


  10. Matias
    Matias avatar
    13 posts
    Member since:
    Jan 2013

    Posted 25 Mar 2013 Link to this post

    Awesome work Denis!

    Sorry for being late on my answer, but I'm glad Stefan helped you out on this.

    If you have any other questions please do not hesitate to ask, will always try my best to help you out.
    Have fun and enjoy,

     - Matias
  11. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 28 Mar 2013 Link to this post

    Hi Dennis,

    You are right. Thank you for noticing and sharing.
     

    All the best,
    Stefan
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top
UI for WinForms is Visual Studio 2017 Ready