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

Is there an event to know if the user scrolled to another month?

1 Answer 35 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fabio
Top achievements
Rank 1
Fabio asked on 16 Jun 2015, 06:47 PM

Hello

 I want to know if there is an event to tell if the user scrolled to another month. I am trying to use this event:

 

1.protected override void OnScrollChanged (int l, int t, int oldl, int oldt)
2.{
3.    base.OnScrollChanged (l, t, oldl, oldt);
4.}

But I am not sure If I am in the correct way.

Is there an event that tells me on which month I am currently in?

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 19 Jun 2015, 06:58 AM
Hello Fabio,

Yes, you use set an IOnDisplayDateChangedListener implementation by using calendar's SetOnDisplayDateChangedListener:

calendarView.SetOnDisplayDateChangedListener (new MyDisplayDateChangedListener());

Here MyDisplayDateChangedListener is a simple implementation of the IOnDisplayDateChangedListener. Here's an example:

class MyDisplayDateChangedListener : Java.Lang.Object, Com.Telerik.Widget.Calendar.RadCalendarView.IOnDisplayDateChangedListener {
    public void OnDisplayDateChanged (long oldDate, long newDate)
    {
        GregorianCalendar calendar = new GregorianCalendar ();
        calendar.TimeInMillis = newDate;
        String newMonth = new SimpleDateFormat("MMMM").Format(calendar.Time);
    }
}

I hope this helps.

Regards,
Todor
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
Tags
Calendar
Asked by
Fabio
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or