Add a dropDownList in CreateChildElement

3 posts, 0 answers
  1. Giovanni De Lazzari
    Giovanni De Lazzari avatar
    16 posts
    Member since:
    Sep 2006

    Posted 15 Nov 2012 Link to this post

    Hi , I have to do a list of thumb images with on the left side a dropdown to select a print format
    but whe I try to add a RadDropDownList
    to this.Children in the CreateChildElements event I get this error "unknown method add(Telerik.WinControl.UI.RadDropDownList) of telerik.wincontrol.radElementCollection

    here is the code
    protected override void CreateChildElements()
                 this.stackLayout = new StackLayoutPanel();
                 this.stackLayout.Orientation = Orientation.Horizontal;
                 this.contentElement = new LightVisualElement();
                   this.contentElement.StretchHorizontally = true;
                 this.contentElement.MinSize = new Size(220, 2200);
                 imageElement = new clsBackDropItem(null,160,106);
                 imageElement.ImageLayout = System.Windows.Forms.ImageLayout.Center;
                 this.buttonElement2 = new RadButtonElement();
                 this.buttonElement2.Text = "Button2";
                 this.dd=new RadDropDownList();

    thanks in advance for any suggestion
  2. Giovanni De Lazzari
    Giovanni De Lazzari avatar
    16 posts
    Member since:
    Sep 2006

    Posted 17 Nov 2012 Link to this post

    Again if I try to add a checkBox I get the same error, any  Idea ?
    chkBoxSelect = new RadCheckBox();
                  chkBoxSelect.Text = "Aggiungi";
                  chkBoxSelect.Font=new System.Drawing.Font("Segoe UI", 8, FontStyle.Regular, GraphicsUnit.Point);
  3. DevCraft banner
  4. Ivan Todorov
    Ivan Todorov avatar
    688 posts

    Posted 20 Nov 2012 Link to this post

    Hi Giovanni,

    Thank you for your question.

    The Children collection of our elements can contain only instances that inherit from the base RadElement class and the RadDropDownList and RadCheckBox inherit from the RadControl class. This is how our Telerik Presentation Framework is designed. Each RadControl has a RootElement which is a special inheritor of the RadElement class and it hold the main element for a control. Here you can find more about the class hierarchy in the TPF.

    In your case, you should use RadCheckBoxElement instead of RadCheckBox, and RadDropDownListElement instead of RadDropDownList (these are the main elements of the respective controls).

    Should you have any additional questions, do not hesitate to write back.

    Ivan Todorov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top