This is a migrated thread and some comments may be shown as answers.

Set min/max size of dropdown

3 Answers 144 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Artem asked on 17 Aug 2020, 07:43 AM
How can i set min/max size of dropdown?

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Aug 2020, 07:56 AM

Hi, Artem, 

RadDateTimePicker offers the CalendarSize property which allows you to specify the size of the calendar in the drop down.

As to the minimum/maximum size of the drop down, you can use the following code snippet: 

            RadDateTimePickerCalendar calBehavior = this.radDateTimePicker1.DateTimePickerElement.CurrentBehavior as RadDateTimePickerCalendar;
            calBehavior.DropDownMinSize = new Size(300, 300);
            calBehavior.DropDownMaxSize = new Size(600,600);

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

0
Artem
Top achievements
Rank 1
answered on 17 Aug 2020, 08:07 AM
Thank you for the answer!

I've already tried this solution, but it didn't work. I lost opportunity to resize calendar at all.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Aug 2020, 09:05 AM

Hello, Artem,

Indeed, the user is allowed to shrink the width, but not the height. 

I have logged it in our feedback portal by creating a public thread on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to use the following code snippet:

        public RadForm1()
        {
            InitializeComponent();
            //this.radDateTimePicker1.CalendarSize = new Size(500, 500);


            
            RadDateTimePickerCalendar calBehavior = this.radDateTimePicker1.DateTimePickerElement.CurrentBehavior as RadDateTimePickerCalendar;
            calBehavior.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
            calBehavior.DropDownMinSize = new Size(400, 400);
            calBehavior.DropDownMaxSize = new Size(600, 600);

           this.radDateTimePicker1.Opened+=radDateTimePicker1_Opened;
        }

        private void radDateTimePicker1_Opened(object sender, EventArgs e)
        {
            RadDateTimePickerCalendar calBehavior = this.radDateTimePicker1.DateTimePickerElement.CurrentBehavior as RadDateTimePickerCalendar;
            calBehavior.PopupControl.MinimumSize= calBehavior.DropDownMinSize;
        }

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Tags
DateTimePicker
Asked by
Artem
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Artem
Top achievements
Rank 1
Share this question
or