Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

datePicker : maximumdate and minimumdate aren't working correctly when customizing the picker.

I have been trying to use the date picker with

if I choos a value greter the MaximumDate and less then MinimumDate it's working perfectly but the effect

is not working when having a renderer datePicker

am I missing something, or is it a bug from xamarin??


  • LeonLuLeonLu Member, Xamarin Team Xamurai

    I create a custom renderer for picker.I set the following code.

          public class DatePickerCtrlRenderer: DatePickerRenderer
        public DatePickerCtrlRenderer(Context context) : base(context)
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.DatePicker> e)
            MyPicker element = Element as MyPicker;
            element.MinimumDate = new DateTime(2019, 9, 11);
            element.MaximumDate = new DateTime(2019, 9, 20);

    It work normally, you can refer to this screenshot.

Sign In or Register to comment.