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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With