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

Calendar SelectionMode Single not working

1 Answer 50 Views
Calendar - Xamarin.Android
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 19 May 2015, 01:08 PM

Hi,

 I'm trying out a new POC for Android and using the Calendar widget.  It looks very promising, but I can't even get the SelectionMode single working.  Here is my code, from looking at the documentation it should be working.

 

<com.telerik.widget.calendar.RadCalendarView
           android:id="@+id/calendarView"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           calendar:selectionMode="Single" />

I've also tried setting it in the Activity:

RadCalendarView calendar = FindViewById<RadCalendarView> (Resource.Id.calendarView);
            calendar.SelectionMode = CalendarSelectionMode.Single;

 As you can see from the image below, it is still selecting multiple dates...

 

Here is what my calendar looks like:

1 Answer, 1 is accepted

Sort by
0
Antony Jekov
Telerik team
answered on 21 May 2015, 01:20 PM
Hello Kyle,

Thank you for contacting the Android team.

I confirmed that the xml attribute does not apply in the Xamarin Wrappers. I will log this as an issue and it will be fixed. Thank you for reporting this. We appreciate your feedback!

Regarding setting the selection mode from code, you should do the following for Xamarin:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
 
    <com.telerik.widget.calendar.RadCalendarView
        android:id="@+id/calendarView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
 
</FrameLayout>
And setting the value:
SetContentView(Resource.Layout.Main);
RadCalendarView calendar = FindViewById (Resource.Id.calendarView).JavaCast<RadCalendarView>();
calendar.SelectionMode = CalendarSelectionMode.Single;

This should work as expected. Let me know if you still have any troubles.

Regards,
Antony Jekov
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 - Xamarin.Android
Asked by
Kyle
Top achievements
Rank 1
Answers by
Antony Jekov
Telerik team
Share this question
or