Completed
Last Updated: 20 Nov 2014 14:46 by ADMIN
ADMIN
Dimitar
Created on: 13 Nov 2014 09:38
Category:
Type: Bug Report
0
FIX. RadDropDownList - exception when the AutoSizeItems is set to true and the list has no items.
To reproduce:
- Add blank drop down list to a form and set AutoSizeItems = true.
- Start and try to open the drop down.

Workaround:

public class MyRadRopDownList : RadDropDownList
{
    protected override RadDropDownListElement CreateDropDownListElement()
    {
        return new MyRadDropDownListElement();
    }
}
public class MyRadDropDownListElement : RadDropDownListElement
{
    protected override Size GetPopupSize(RadPopupControlBase popup, bool measure)
    {
        if (this.Items.Count == 0 && this.AutoSizeItems)
        {
            return new Size(0, 0);
        }
        return base.GetPopupSize(popup, measure);
    }
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadDropDownListElement);
        }
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments