Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open the datepicker calendar without showing the edittextbox in xamarin.forms

I am using DatePicker control of Xamarin.Forms in my app.I have a button and I want to open a popup in which I want to show the calendar of DatePicker. But currently when I open the popup, the edittexbox shows with current date and when I tap on the textbox then calendar opens. But I don't want the edit texbox. I just want to show the calendar when user tap on the button.
Anyone know how I can do this?

like image 297
anand Avatar asked Dec 07 '15 08:12

anand


People also ask

What is datepicker in Xamarin forms?

A Xamarin.Forms view that allows the user to select a date. The Xamarin.Forms DatePicker invokes the platform's date-picker control and allows the user to select a date.

How do I select a date in Xamarin forms?

A Xamarin.Forms view that allows the user to select a date. The Xamarin.Forms DatePicker invokes the platform's date-picker control and allows the user to select a date. DatePicker defines eight properties: MinimumDate of type DateTime, which defaults to the first day of the year 1900.

What is datepickerdialog in Android?

The DatePicker allows users to select the year, month, and day in a consistent interface across devices and applications. The DatePickerDialog is a helper class that encapsulates the DatePicker in a dialog. Modern Android applications should display the DatePickerDialog in a DialogFragment.

How to display the date on the Calendar label in XAML?

In this, we use DatePicker for displaying the calendar. For that calendar, let us set the minimum and maximum ranges of that calendar. Then, use an event for displaying the date on the label. Now, open MainPage.xaml.cs file for writing the code.


1 Answers

Make the DatePicker control hidden by setting IsVisible=false. Then you can trigger it programmatically by calling the Focus() method from elsewhere in your code.

like image 80
Jason Avatar answered Sep 27 '22 19:09

Jason