Calendar SelectionMode Single not working

2 posts, 0 answers
  1. Kyle
    Kyle avatar
    30 posts
    Member since:
    Dec 2014

    Posted 19 May 2015 Link to this post

    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:

  2. Antony Jekov
    Admin
    Antony Jekov avatar
    88 posts

    Posted 21 May 2015 Link to this post

    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
  3. DevCraft banner
Back to Top