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

Inheriting RadTextbox with Multiline problems

1 Answer 48 Views
This is a migrated thread and some comments may be shown as answers.
Jorge Delgado-Lopez
Top achievements
Rank 1
Jorge Delgado-Lopez asked on 30 Jan 2009, 08:38 AM

I am upgrading from an old solution, see, since this version is missing some functionality which I now need.

My class inherits from RadTextBox where I override CreateChildItems and create my own.

I follow the logic from your source and it all works perfectly. Except the multiline property, how can I implement it?

I use the following controls.
        private readonly RadTextBoxItem textBox = new RadTextBoxItem();
        private readonly TextPrimitive title = new TextPrimitive();
        private readonly TextPrimitive validation = new TextPrimitive();

A cut down version of CreateChildItems

            BoxLayout layoutTexts = new BoxLayout();
            layoutTexts.Orientation = Orientation.Horizontal;
            layoutTexts.StretchVertically = false;  // when true the control is drawn differently


            BoxLayout layout = new BoxLayout();
            layout.Orientation = Orientation.Vertical;





            Size = new Size(425, 34); // default size

- jorge

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 02 Feb 2009, 03:23 PM
Hi Jorge Delgado-Lopez,

Thank for writing.

You should set the Control's AutoSize property to false
  public LabelMultilineTextBox() 
       this.AutoSize = false

Also, override InitializeRootElement and set the RootElement's Stretch Property to True
 protected override void InitializeRootElement(RootRadElement rootElement) 
       rootElement.StretchVertically = true;            

Please refer the attached project.

the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Jorge Delgado-Lopez
Top achievements
Rank 1
Answers by
Telerik team
Share this question