Hello -
I'm trying to cause a RadTextBoxElement to automatically size to its text, similar to the way a TextPrimitive automatically sizes to its text. Here is the code snippet:
| public Form1() |
| { |
| StackLayoutPanel panel = new StackLayoutPanel(); |
| panel.Orientation = Orientation.Horizontal; |
| panel.AutoSize = true; |
| panel.Children.Add(new TextPrimitive() { Text = "Color:" }); |
| panel.Children.Add(new RadTextBoxElement() { Text = "Purple" }); |
| RadPanel elementsContainer = new RadPanel(); |
| elementsContainer.ThemeName = "Desert"; |
| elementsContainer.PanelElement.Children.Add(panel); |
| Controls.Add(elementsContainer); |
| } |
The TextPrimitive properly sizes to its text ("Color:"), but the RadTextBoxElement fails to size to its text ("Purple"). If I set AutoSize = true on the RadTextBoxElement, nothing changes. If I also set the AutoSizeMode to WrapAroundChildren, still no change. Can you advise me on how to make this work?
Thanks,
Michael Hewitt
Precision Software Design, LLC