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

Drop Down Behavior Changes

7 Answers 141 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 18 May 2017, 02:33 PM

I have a drop down list that functions normally the first time I click the down arrow (the whole list of items displays).  On subsequent clicks the drop down list is only half the height of the control.  The pictures are attached.

I have some code to modify the font size and drop down arrow width..

// DropDownList ddlShortPick
ddlShortPick.ListElement.AutoSizeItems = true;
foreach (RadListDataItem x in ddlShortPick.ListElement.Items)
{
    x.Font = ddlShortPick.Font;
}
ddlShortPick.DropDownListElement.ArrowButton.MinSize = new Size(50, 0);

 

And these are the settings in the designer...

//
// ddlShortPick
//
this.ddlShortPick.AutoSize = false;
this.ddlShortPick.AutoSizeItems = true;
this.ddlShortPick.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
this.ddlShortPick.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ddlShortPick.Location = new System.Drawing.Point(559, 5);
this.ddlShortPick.Name = "ddlShortPick";
this.ddlShortPick.Size = new System.Drawing.Size(320, 31);
this.ddlShortPick.TabIndex = 32;
((Telerik.WinControls.UI.RadDropDownListElement)(this.ddlShortPick.GetChildAt(0))).DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;

 

Any idea what would be corrupting the behavior of the control?

 

Thank you,

Gary

7 Answers, 1 is accepted

Sort by
0
Jay
Top achievements
Rank 1
answered on 18 May 2017, 04:10 PM
I also just checked another drop down on a different form in my project.  It's doing the same thing.
0
Hristo
Telerik team
answered on 19 May 2017, 11:30 AM
Hello Gary,

Thank you for writing.

We are currently not aware of a similar issue. Can you please check how is the popup opening with disabled animations: 
this.radDropDownList1.DropDownAnimationEnabled = true;

In case you keep experiencing the issue please send us a sample project so that we can test it locally. Please also let us know if you have enabled DPI scaling by changing your manifest file.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Phil
Top achievements
Rank 1
answered on 08 Jul 2017, 03:23 AM

I am experiencing the same behaviour as the original poster.

In our DropDownLists we have a number of really long items which we want to automatically size so they are more easily visible and readable. There aren't loads of them but we often have many similar items where the only differentiating text is at the end and it's impossible to tell which one is which without this behaviour. We do this by setting AutoSizeItems = true;

In the 2016 Q1 release we implemented this perfectly according to our requirements. In the 2017 R2 release this is now broken.

This behaviour is broken without any themes applied and also if the VisualStudio2012Light theme is applied (see attached image). I haven't tested any other themes.

Disabling animations makes no difference.

I am working in .NET 4.5 and don't have .NET 4.7 installed and there is no custom manifest.

Since this basically renders the list useless afterwards we need to fix this ASAP. Are there any workarounds for this?

I see there is a 2017 R2 SP1 out but I am loathe to update to this version unless it definitely fixes the issue. Every time we update, existing behaviour is changed or broken.

Here is sample code:

static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }
}
 
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }
}
 
partial class Form1
{
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
 
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }
 
    #region Windows Form Designer generated code
 
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
        Telerik.WinControls.UI.RadListDataItem radListDataItem1 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem2 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem3 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem4 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem5 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem6 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem7 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem8 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem9 = new Telerik.WinControls.UI.RadListDataItem();
        Telerik.WinControls.UI.RadListDataItem radListDataItem10 = new Telerik.WinControls.UI.RadListDataItem();
        this.radDropDownList1 = new Telerik.WinControls.UI.RadDropDownList();
        ((System.ComponentModel.ISupportInitialize)(this.radDropDownList1)).BeginInit();
        this.SuspendLayout();
        //
        // radDropDownList1
        //
        this.radDropDownList1.AutoSizeItems = true;
        this.radDropDownList1.DropDownAnimationEnabled = false;
        radListDataItem1.Text = "ListItem 1";
        radListDataItem2.Text = "ListItem 2";
        radListDataItem3.Text = "ListItem 3";
        radListDataItem4.Text = "ListItem 4";
        radListDataItem5.Text = "ListItem 5";
        radListDataItem6.Text = "ListItem 6";
        radListDataItem7.Text = "ListItem 7";
        radListDataItem8.Text = "ListItem 8";
        radListDataItem9.Text = "ListItem 9";
        radListDataItem10.Text = "ListItem 10";
        this.radDropDownList1.Items.Add(radListDataItem1);
        this.radDropDownList1.Items.Add(radListDataItem2);
        this.radDropDownList1.Items.Add(radListDataItem3);
        this.radDropDownList1.Items.Add(radListDataItem4);
        this.radDropDownList1.Items.Add(radListDataItem5);
        this.radDropDownList1.Items.Add(radListDataItem6);
        this.radDropDownList1.Items.Add(radListDataItem7);
        this.radDropDownList1.Items.Add(radListDataItem8);
        this.radDropDownList1.Items.Add(radListDataItem9);
        this.radDropDownList1.Items.Add(radListDataItem10);
        this.radDropDownList1.Location = new System.Drawing.Point(82, 112);
        this.radDropDownList1.Name = "radDropDownList1";
        this.radDropDownList1.Size = new System.Drawing.Size(125, 20);
        this.radDropDownList1.TabIndex = 0;
        //
        // Form1
        //
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(284, 261);
        this.Controls.Add(this.radDropDownList1);
        this.Name = "Form1";
        this.Text = "Form1";
        ((System.ComponentModel.ISupportInitialize)(this.radDropDownList1)).EndInit();
        this.ResumeLayout(false);
        this.PerformLayout();
 
    }
 
    #endregion
 
    private Telerik.WinControls.UI.RadDropDownList radDropDownList1;
}
0
Jay
Top achievements
Rank 1
answered on 08 Jul 2017, 04:07 AM

I entered a support ticket and they determined it is a bug with auto size items.  The work around is to set the drop down minimum size.

 

I didn't check to see if it is fixed in this latest release. I forgot to check.  But I normally have no problems with updates.

0
Jay
Top achievements
Rank 1
answered on 08 Jul 2017, 12:46 PM

There is a work around:

radDropDownList1.DropDownMinSize = new Size(0,1);

 

I submitted a ticket regarding this and it was confirmed as a bug with AutoSizeItems = true.  And, while they work on a fix, they told told me the work around.  Their response was actually "new Size(0,90)".  I was just checking and I experimented.  You get the same (good) result with any positive number for the height.

0
Hristo
Telerik team
answered on 10 Jul 2017, 12:04 PM
Hello Gary,

Thank you for writing.

I managed to reproduce the issue and it appears to be an already known one: FIX. RadDropDownList - invalid DropDown size when the font is changed and the items are auto-sized. The item has already been fixed in the development branch and it will be made available with our R3 release. Until then you can use the workaround and set the DropDownMinSize property.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Phil
Top achievements
Rank 1
answered on 10 Jul 2017, 08:44 PM
Thanks Gary! Workaround sorted the issue out for now.
Tags
DropDownList
Asked by
Jay
Top achievements
Rank 1
Answers by
Jay
Top achievements
Rank 1
Hristo
Telerik team
Phil
Top achievements
Rank 1
Share this question
or