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

Hide Title + Hide week navigation in mode Day- Lack of documentation

13 Answers 196 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Olivier
Top achievements
Rank 1
Olivier asked on 20 Nov 2018, 09:38 AM

Hi,

I don't find any documentation on the RadCalendar.

For such a complex control I would expect more documentation : it only shows how to customize cells and not much more.

Few documentation on how to customize something else.
If anybody managed to remove the title of a calendar (e.g: November 2018) and how to remove the navigation panel in CalendarViewMode.Day as I'm looking for a way to display only the schedule : the user shouldn't be able to select another day or to see the other days of the week otherwise he will want to "click" on them and I don't want him to be frustrated :D )

I also want to hide the "days panel" in mode Day because of my layout : a TabbedPage with 3 page : 1 page for a calendar in mode month, 1 in mode week, 1 in mode days. The 3 calendar share the same SelectedDate (with a binding twoway). When I'm on the month tabPage, if I slide on the calendar to change the displayed month, the SelectedDate is set (I don't know how) by the Day tabPage (I expect the SelectedDate to not change until I tap on a date). That's why I have disabled the binding on SelectedDate for the page Day (and the main reason why I need to disable the "days panel" in mode Day.

Any help will be appreciated.

I've attached 2 videos showing the difference between OneWay and TwoWay on the bindong of SelectedDate on the Day view / page.

(ahhh... 2MB max... And only jpg gif png allowed...)

One way : [url=https://nofile.io/f/tHzK16jFOPg/OneWay.mp4]OneWay.mp4[/url]

TwoWay : [url=https://nofile.io/f/rBUBdJaY3Ry/TwoWay.mp4]TwoWay.mp4[/url]

 

Thanks

 

 

 

13 Answers, 1 is accepted

Sort by
0
Olivier
Top achievements
Rank 1
answered on 20 Nov 2018, 09:41 AM

Sorry here are the hyperlinks to see the videos : OneWay & TwoWays

https://nofile.io/f/tHzK16jFOPg/OneWay.mp4
https://nofile.io/f/rBUBdJaY3Ry/TwoWay.mp4

 

0
Yana
Telerik team
answered on 21 Nov 2018, 09:40 AM
Hello Olivier,

Indeed, the documentation of RadCalendar lacks some content and we're working on adding the missing bits. Sorry for the caused inconvenience.

Straight to the raised questions:

1. Regarding removing the Title - there is no direct API in Calendar for Xamarin.Forms for this, however, you could implement it natively for Android and iOS through custom renderers. Here are quick examples:

- for Android you would need to set ShowTitle property:

public class CustomCalendarRenderer : CalendarRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
    {
        base.OnElementChanged(e);
 
        if (this.Control != null)
        {
            this.Control.ShowTitle = false;            
        }
    }
}

- for iOS you would need to get TKCalendarMonthPresenter and set its TitleHidden property:

public class CustomCalendarRenderer : Telerik.XamarinForms.InputRenderer.iOS.CalendarRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
    {
        base.OnElementChanged(e);
        if (Control.Presenter is TKCalendarMonthPresenter)
        {
            (Control.Presenter as TKCalendarMonthPresenter).TitleHidden = true;
        }
    }
}

2. Regarding preventing navigation - you could apply MinDate and MaxDate properties of RadCalendar in order to restrict the visible days.  These properties could be bound to your ViewModel and updated according to the current ViewMode. For more details check Date Properties topic.

3. Regarding DayView -  I would suggest you take a look at the new MultiDay ViewMode as it is similar to the DayView, but without the days panel. For more details on it and the possible customizations check MultiDay View topic.

I have attached a sample app to demonstrates how my suggestions regarding these issues would work. Please download the attachment and give it a try.

4. As to binding SelectedDate - I didn't manage to check the TwoWays video as it gives me "File not found" error.  I would ask you for more details on the exact setup and ViewModel in order to investigate this further.

Lastly, regarding our forums policy - indeed, only image attachments with max file size of 20 mb are allowed in our forums due to security reasons.  If you need to send us other types of files, please submit a support ticket and attach them there. Thank you for the understanding.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Olivier
Top achievements
Rank 1
answered on 22 Nov 2018, 04:39 PM

Woaw, you guys rock.
I did not expect as much help :)

I will try the multi view and the custom renderer.

I wish you the best ! Have a good day Yana

0
Olivier
Top achievements
Rank 1
answered on 26 Nov 2018, 02:55 PM

I found the behavior I wanted with this code VisibleDays="1" and the CalendarViewMode set to MultiDay.

The only problem I still have is that in this mode, when I slide on the control, it doesn't update the binded date property SelectedDate whereas it display the previous / next day. (yes, the binding mode is set to TwoWay). Same for the SelectionChanged event : not triggered. Notice that the binding for DisplayDate is working.

I understand that technicaly, the value which change is the DisplayDate but I was expecting the SelectedDate to change too as I only display one date (IMHO a property should exist to say if we want the SelectedDate to follow the DisplayDate when CalendarViewMode  is set to either Day or MultiDay.

Is it a known issue or am I missing something ?

The workaround I found is the following one (I paste my code as it might help other people).
I test the difference of displayed days because I have 3 calendar : month, week, multiday. 
Calendar is 30 days diff, week is 7 days diff, and multiDay is 1 day. I test the abs otherwise it won't work if I slide the current day to the previous day.

private void RadCalendar_DisplayDateChanged(object sender, ValueChangedEventArgs<object> e)
{
    if (e.PreviousValue is DateTime previousDate && e.NewValue is DateTime newDate)
    {
        if (Math.Abs(newDate.DayOfYear - previousDate.DayOfYear) == 1)
        {
            (BindingContext as AgendaPageViewModel).SelectedDate = newDate;
        }
    }
}

 

But as I don't like to have a dependency from my page code behind to my page's viewModel, I don't like this solution and consider it as a hack.

 

Does anyone have a better solution ?

0
Yana
Telerik team
answered on 27 Nov 2018, 08:51 AM
Hi Olivier,

I am glad to hear the new MultiDay view of RadCalendar fulfills the requirements you've had.

As to the selection feature - SelectedDate property is updated either programmatically (I mean when you explicitly update its Value) or when the user taps on a calendar cell.  It is not bound with the DisplayDate and there is no internal logic to check the count of the currently visible days and to update the selection accordingly.

Basically, the way you've found is good, and since you have bound both DisplayDate and SelectedDate, you could implement the same approach in the ViewModel inside the DisplayDate setter.

I hope this would be helpful.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kaan
Top achievements
Rank 1
answered on 07 Jan 2021, 01:17 PM
Do you have new links to the videos? They don't work anymore.
0
Yana
Telerik team
answered on 07 Jan 2021, 02:51 PM

Hi Kaan,

These were customer's videos and the server they were on is not available any more, we do not have the videos on our side.

Anyway, if you have any concrete question on our Calendar & Scheduling control, I'll be happy to help.

Regards,
Yana
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Kaan
Top achievements
Rank 1
answered on 08 Jan 2021, 12:04 PM

Hi Yana,

How can I hide the week navigation and scale the cell height in dayview? I want to show at least from 8 am - 8 pm without scrolling.

If I use MultiDayView selecting 1 Day, I get the View I want. But ScrollAppointmentIntoView does not work and I have to scroll to 8 am.

 

0
Kaan
Top achievements
Rank 1
answered on 11 Jan 2021, 11:23 AM

Hi Yana,

Can I get support, please?

Best regards,

Kaan

0
Yana
Telerik team
answered on 11 Jan 2021, 01:15 PM

Hi Kaan,

As you already found out, you would need to use MultiDay View with VisibleDays set to "1"  - it's the same as DayView, but without the week navigation panel at the top. I've checked the methods for programmatic scrolling (ScrollTimeIntoView and ScrollAppointmentIntoView) and they work properly.  If you call them inside the constructor,  use a Dispatcher to ensure the Calendar is fully loaded:

Dispatcher.BeginInvokeOnMainThread(() => {
    TimeSpan time = TimeSpan.FromHours(8);
    calendar.ScrollTimeIntoView(time);
});

As to the cell height - we have a feature request regarding this in our public feedback portal, you can cast your vote and track its status at the link below:

Calendar: Provide an option to define height between time lines in DayView/MultiDayView

I remain at your disposal if any additional questions pop up.

Regards,
Yana
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Lance | Manager Technical Support
Telerik team
answered on 11 Jan 2021, 03:15 PM

Hello Kaan,

I see that you were asking for a faster response, which made me wonder if you were aware of the expectations of forums vs official technical support.

So, I took a moment to review your account to see if I could help clarify this and get you the best possible experience using our controls and interacting with the Support team.

Forums vs Support Ticket

Are you aware that forums are not guaranteed a professional support response from the development or support team? We do our best to get to all questions, but there is a priority order and depending on the available resources, it may take several days to get a response (especially when there is a weekend or there are Support Tickets ahead of you).

For the fastest possible response, please open Technical Support Ticket instead of posting in the forums. Priority Support tickets have a guaranteed <24 hour response time (Lite support is 72 hr).

Unlicensed License

I looked at your account and you do not have a license for Telerik UI for Xamarin (nor a trial). Using the product unlicensed is against the License Policy. In many cases, this happens because your company purchased the license and you are the developer... but they forgot to assign you to the license.

Don't worry, there is a simple and fast solution, it literally takes lass than 1 minute to complete!

Solution

to fix this, and for you to get access to Technical support, please ask your company to assign you as the licensed user. I have attached Manage-Licensed-Users.zip tutorial that you can send them.

It is just a couple steps that assigns the license to your Telerik account. Once that happens, you will be able to open support cases and legally develop/use the product in your projects.

* The company will always remain the owner of the license and can change License User at any time.

I hope this helps explain this, please let me know if you would like to chat further. I could also put you in contact with the sales team if you need help with the company licenses (you can add an extra 'dev seat' to a license without buying a completely new license).

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Kaan
Top achievements
Rank 1
answered on 11 Jan 2021, 03:27 PM

Hi Lance,

I should have a trial Account. I talked with Kaloyan Stoychev and I got more time to test telerik. Could you ask him if he extended my trial?

Best regards,

Kaan

0
Lance | Manager Technical Support
Telerik team
answered on 11 Jan 2021, 03:35 PM

Hi Kaan,

Thanks for the update. Indeed, this account has an active trial license until Jan 13th, 2021. So you're good on that side of things, all of the other information I shared is still relevant.

I don't want to downplay the important of forums, they are an excellent resource. However, if you are in a time crunch, I wanted to make sure you were aware of Support Tickets.

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Calendar & Scheduling
Asked by
Olivier
Top achievements
Rank 1
Answers by
Olivier
Top achievements
Rank 1
Yana
Telerik team
Kaan
Top achievements
Rank 1
Lance | Manager Technical Support
Telerik team
Share this question
or