RadDropDownList with VisualStudio2012Light theme issues

4 posts, 0 answers
  1. Phil
    Phil avatar
    15 posts
    Member since:
    Oct 2012

    Posted 13 Jan Link to this post

    I'm having issues with the theming of the RadDropDownList using the VisualStudio2012Light theme. I've set my RDDL to have a height of 20px and without theming the text vertically centers normally and there are no hassles whatsoever. As soon as I apply the theme then things start getting pear shaped.

    The RDDL automatically adjusts its height to 24px which is not what I want. This mismatches all the other controls I have with the same theme - none of them resize when the theme is applied.

    When I adjust the height of the RDDL to 20px after the theming has been applied the height adjusts fine but the text remains in the same position and gets cut off. The offset doesn't adjust.

    I know in the past themes have been buggy at times but this is the first time I've come across this particular issue. I can say for certain that with 2013.2.724.40 this wasn't an issue but after checking some other versions it was also a problem in 2015 Q2.

    I'm using VS2012, .NET 4.0. The attached image shows:

    1. How the text is cut off

    2. How the RDDL resized itself

    3. How the RDDL compares to a RadTextBox and a RadDateTimePicker

  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 18 Jan Link to this post

    Hello Phil,

    Thank you for writing.

    In order to limit RadDropDownList's height, you should set its MaximumSize property. Additionally, it is necessary to resize the nested TextBox inside:
    public Form1()
    {
        InitializeComponent();
     
        ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Light";
     
        this.radDropDownList1.MaximumSize = new Size(200, 20);
        this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.MinSize = new Size(0, 19);
        this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.TextBoxControl.MinimumSize = new Size(0, 18); 
    }

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Phil
    Phil avatar
    15 posts
    Member since:
    Oct 2012

    Posted 18 Jan Link to this post

    Dess, thanks for the guidance. In order to get the text to match up with default styling the end result was:

     

    public Form1()
    {
        InitializeComponent();
      
        ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Light";
      
        this.radDropDownList1.MaximumSize = new Size(200, 20);
        this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.Location = new System.Drawing.Point(this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.Location.X, this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.Location.Y + 1);
        this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.MinSize = new System.Drawing.Size(0, paHeight - 3);
      this.radDropDownList1.DropDownListElement.TextBox.TextBoxItem.TextBoxControl.MinimumSize = new System.Drawing.Size(0, paHeight - 4);
    }

  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 19 Jan Link to this post

    Hello Phil,

    Thank you for writing back. 

    I am glad that the suggested approach helped you to achieve the desired look. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top