DropDownList size/length/displayed item count (Solution)

1 posts, 0 answers
  1. Holger Boskugel
    Holger Boskugel avatar
    24 posts
    Member since:
    Apr 2012

    Posted 16 Jul 2012 Link to this post


    I looked sometimes for a solution to change the count of items displayed in the Popup of the RadDropDownListEditorElement.

    My solution now is:

    Use of EditorRequired event from RadPropertyGrid, Setting the editor to RadDropDownListEditor. Getting the EditorElement as RadDropDownListEditorElement and define the MinSize of Popup as follows:

    RadDropDownListEditor editor = new RadDropDownListEditor(); 
    RadDropDownListEditorElement element = editor.EditorElement as RadDropDownListEditorElement; 
    element.Popup.MinimumSize = new System.Drawing.Size(element.Popup.MinimumSize.Width, 
                                            element.ItemHeight * 10); 
    editor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; 
    e.Editor = editor;

    where as 10 ist the count of items to be displayed.

    Regards from Leipzig

Back to Top