This is a migrated thread and some comments may be shown as answers.

Scheduler Navigator Text

9 Answers 196 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Denis Cilliers
Top achievements
Rank 1
Denis Cilliers asked on 08 Mar 2013, 10:59 AM
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


9 Answers, 1 is accepted

Sort by
0
Accepted
Matias
Top achievements
Rank 1
answered on 08 Mar 2013, 06:41 PM
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.
0
Stefan
Telerik team
answered on 12 Mar 2013, 01:08 PM
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.
0
Denis Cilliers
Top achievements
Rank 1
answered on 20 Mar 2013, 12:27 PM
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




0
Matias
Top achievements
Rank 1
answered on 21 Mar 2013, 01:48 PM
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
0
Denis Cilliers
Top achievements
Rank 1
answered on 22 Mar 2013, 12:43 PM
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
0
Stefan
Telerik team
answered on 25 Mar 2013, 10:18 AM
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.
0
Denis Cilliers
Top achievements
Rank 1
answered on 25 Mar 2013, 11:41 AM
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 


0
Matias
Top achievements
Rank 1
answered on 25 Mar 2013, 02:23 PM
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
0
Stefan
Telerik team
answered on 28 Mar 2013, 07:50 AM
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.
Tags
Scheduler and Reminder
Asked by
Denis Cilliers
Top achievements
Rank 1
Answers by
Matias
Top achievements
Rank 1
Stefan
Telerik team
Denis Cilliers
Top achievements
Rank 1
Share this question
or