Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022
Raf
Created on: 01 Feb 2022 09:21
Category: DropDownList
Type: Bug Report
2
RadDropDownList: Height is changed with enabled AutoSize, DropDownStyle=DropDownList and no text

Use the following code snippet and refer to the attached gif file:

        private RadDropDownList Drop { get; set; }
        public RadForm1()
        {
            InitializeComponent();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Drop = new RadDropDownList();
            this.Drop.AutoSize = true;
            this.Drop.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; //So users can't write. 
            this.Drop.Font = new Font("Segoe UI", 11.25f, FontStyle.Regular, GraphicsUnit.Point);

            RadListDataItem item = new RadListDataItem();
            item.Value = string.Empty;
            item.Text = string.Empty;
            this.Drop.Items.Add(item);

            RadListDataItem item2 = new RadListDataItem();
            item2.Value = "Hello";
            item2.Text = "Hello";
            this.Drop.Items.Add(item2);

            this.Controls.Add(this.Drop);

            this.Drop.SizeChanged += Drop_SizeChanged;

        }

        private void Drop_SizeChanged(object sender, EventArgs e)
        {
            this.Text = this.Drop.Size.ToString();
        }
    }

Attached Files:
0 comments