6 Answers, 1 is accepted
0
Hello Rincy,
Thank you for writing.
By default a selected cell is being deselected when taped. The only exception would be the range selection mode, where you cannot disable the first selected date.
What type of selection are you using? Single, multiple or range?
Regards,
Antony Jekov
Telerik
Thank you for writing.
By default a selected cell is being deselected when taped. The only exception would be the range selection mode, where you cannot disable the first selected date.
What type of selection are you using? Single, multiple or range?
Regards,
Antony Jekov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
rincy
Top achievements
Rank 1
answered on 20 Mar 2015, 08:59 AM
I want single selection only.But couldnt find how to do single selection so am usingion so am using following code to select
private void GoToDate(Calendar cal) {
List<Long> dates = new ArrayList<Long>();
dates.add(cal.getTimeInMillis());
calendarView.setSelectedDates(dates);
calendarView.setDisplayDate(cal.getTimeInMillis());
}
private void GoToDate(Calendar cal) {
List<Long> dates = new ArrayList<Long>();
dates.add(cal.getTimeInMillis());
calendarView.setSelectedDates(dates);
calendarView.setDisplayDate(cal.getTimeInMillis());
}
0
rincy
Top achievements
Rank 1
answered on 20 Mar 2015, 09:46 AM
I got problem.
When am using CalendarSelectionMode single I couldn't deselect it.
calendarView.setSelectionMode(CalendarSelectionMode.Single); when i remove this line i can deselect by tapping the selected . date,but calendar will allow multiple selection.Please gives me a suggestion to resolve this.
I want single selection and when tapping on selected date it should deselect.
When am using CalendarSelectionMode single I couldn't deselect it.
calendarView.setSelectionMode(CalendarSelectionMode.Single); when i remove this line i can deselect by tapping the selected . date,but calendar will allow multiple selection.Please gives me a suggestion to resolve this.
I want single selection and when tapping on selected date it should deselect.
0
Hello ,
As mentioned in the private ticket you sent me, this would be a possible solution:
I will check with our designer and see if I can enable this by default.
Thank you for your time and all best!
Regards,
Antony Jekov
Telerik
As mentioned in the private ticket you sent me, this would be a possible solution:
@Override
protected
void
onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final RadCalendarView calendarView =
new
RadCalendarView(
this
);
calendarView.setSelectionMode(CalendarSelectionMode.Single);
calendarView.setGestureManager(
new
CustomGestureManager(calendarView));
setContentView(calendarView);
}
class
CustomGestureManager extends CalendarGestureManager {
public
CustomGestureManager(RadCalendarView owner) {
super(owner);
}
@Override
protected
void
handleTapGesture(CalendarDayCell calendarCell) {
if
(calendarCell.isSelected()) {
owner.setSelectedDates(
null
);
}
else
{
super.handleTapGesture(calendarCell);
}
}
}
I will check with our designer and see if I can enable this by default.
Thank you for your time and all best!
Regards,
Antony Jekov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
dlhts_swam
Top achievements
Rank 1
answered on 24 Mar 2015, 04:45 AM
Hi,
Hi Antony,
Thanks for your reply.
I have tried this code before by passing null to 'setSelectedDates',But its throwing an exception I'ndexOutOfBoundsException:Invalid index 0,size 0'.I think 'setSelectedDates' wont handle null.Could you please check it out?
Thanks & Regards,
Rincy Rose
Hi Antony,
Thanks for your reply.
I have tried this code before by passing null to 'setSelectedDates',But its throwing an exception I'ndexOutOfBoundsException:Invalid index 0,size 0'.I think 'setSelectedDates' wont handle null.Could you please check it out?
Thanks & Regards,
Rincy Rose
0
Hello ,
Since you sent a private ticket, I am going to proceed and close this one. Please refer to the conversation there.
Regards,
Antony Jekov
Telerik
Since you sent a private ticket, I am going to proceed and close this one. Please refer to the conversation there.
Regards,
Antony Jekov
Telerik
See What's Next in App Development. Register for TelerikNEXT.